Microsoft & .NETVisual BasicVB Coding TIP: Using 'What's This?' Help

VB Coding TIP: Using ‘What’s This?’ Help

Make a new project. To the form set the WhatsThisHelp and WhatsThisButton to True and add a command button with the WhatsThisHelpID=1 and HelpContextID=5

Use the following information to make the menus:

Menu Property Value
WhatsThis Caption WhatsThis
WhatsThis Name mnuWhatsThis
WhatsThis Visible False
What’s This? Caption What’s This?
What’s This Name mnuWhatsThisHelp

Make the What’s This? menu a submenu of WhatsThis

Public ThisControl as control

Private Sub mnuWhatsThisHelp_Click()
ThisControl.ShowWhatsThis 
End Sub

Private Sub Command1_MouseUp(Button As Integer,_ 
Shift As Integer, _X As Single, Y As Single)
If Button = vbRightButton Then 
Set ThisControl = Command1 
PopupMenu mnuWhatsThis 
End If 
Set ThisControl = Nothing 
End Sub

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories