The PanelClick event is similar to the standard Click event but occurs when a user presses and then releases a mouse button over any of the StatusBar control's Panel objects.
Syntax
Private Sub object_PanelClick(ByVal panel As Panel)
The PanelClick event syntax has these parts:
Part | Description |
object | An object expression that evaluates to a StatusBar control. |
panel | A reference to a Panel object. |
Remarks
The standard Click event also occurs when a Panel object is clicked.
The PanelClick event is only generated when the click occurs over a Panel object. When the StatusBar control's Style property is set to Simple style, panels are hidden, and therefore the PanelClick event is not generated.
You can use the reference to the Panel object to set properties for that panel. For example, the following code resets the Bevel property of a clicked Panel:
Private Sub StatusBar1_PanelClick(ByVal Panel As Panel)
Select Case Panel.Key
Case "DisplayFileName" ' Key="DisplayFileName"
Panel.Bevel = sbrRaised ' Reset Bevel property
' Add other case statements for other panels
End Select
End Sub