1 Attachment(s)
VB6 - Add "tooltips" to menu items
This project demonstrates the display of menu item descriptions when a menu item is highlighted. It uses message hooking.
Note: If you have accelerators (eg. & ) in your menu text and/or shortcuts (eg. Ctrl+N) then the GetDescription function in the app needs to be modified as shown below.
VB Code:
Private Function GetDescription(MenuCaption As String) As String
'Determine the description of the menu item.
Select Case MenuCaption
Case "[b]&New" & vbTab & "Ctrl+N[/b]"
GetDescription = "Creates a new document"
Case "Open"
GetDescription = "Opens a Document"
Case "Close"
GetDescription = "Closes Document"
Case "Cut"
GetDescription = "Cuts Selection to Clipboard"
Case "Copy"
GetDescription = "Copies Selection to Clipboard"
Case "Paste"
GetDescription = "Pastes Contents of Clipboard"
Case "Normal"
GetDescription = "Regular Paste"
Case "Special"
GetDescription = "Special Paste"
Case Else
GetDescription = ""
End Select
End Function