Occurs when the user clicks or double clicks on a Panel object in a StatusBar control.
Sub object_PanelClick(p As Panel)
Sub object_PanelDblClick(p As Panel)
object: StatusBar Ocx
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. 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.
Global Enum sbrNoAutoSize = 0, sbrSpring, sbrContents
Ocx StatusBar sb
sb.Panels.Add , , "Hello" : sb.Panel(1).AutoSize = sbrNoAutoSize
sb.Add , , "Hello" : sb.Panel(2).AutoSize = sbrSpring
sb.Panels.Add , , "Hello" : sb.Panel(3).AutoSize = sbrContents
sb.Add , , "Hello" : sb(4).MinWidth = 50 : sb(4).AutoSize = sbrContents
Do : Sleep : Until Me Is Nothing
Sub sb_PanelClick(Panel As Panel)
Message "Single Click on:" & sb_Report(Panel)
EndSub
Sub sb_PanelDblClick(Panel As Panel)
Message "Double Click on:" & sb_Report(Panel)
EndSub
Function sb_Report(Panel As Panel)
Local a$ = " " & Panel.Text & #13#10 & "AutoSize state: "
Select Panel.AutoSize
Case sbrNoAutoSize : a$ = a$ & "sbrNoAutoSize(0)"
Case sbrSpring : a$ = a$ & "sbrSpring(1)"
Case sbrContents : a$ = a$ & "sbrContents(2)"
EndSelect
Return a$
EndFunction
{Created by Sjouke Hamstra; Last updated: 21/10/2014 by James Gaite}