by Francois Allard (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 13th December 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Show ToolTipText of Buttons from a ToolBar in a StatusBar.
Dim ctr As Long, Compt As Double, Found As Boolean
Compt = 0
Found = False
For ctr = 1 To ToolBar.Buttons.Count
If ToolBar.Buttons(ctr).Width > 0 Then
If X >= Compt And X <= Compt + ToolBar.Buttons(ctr).Width Then
If ToolBar.Buttons(ctr).ToolTipText <> "" Then
StatusBar1.Panels(1).Text = ToolBar.Buttons(ctr).ToolTipText
Found = True
End If
End If
Compt = Compt + ToolBar.Buttons(ctr).Width
End If
DoEvents
Next
If Not Found Then
StatusBar1.Panels(1).Text = "Default Text of StatusBar"
End If
End Sub