Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question re context-sensitive help

Status
Not open for further replies.

TomZC

Programmer
Oct 22, 2002
8
0
0
US
I've figured out how to do part of what I want to do. I have a VB app that uses a standard WinHelp file. I want the user to be able to: 1) pull down a menu, select the command he wants info about and hit F1 to get the help page in the WinHelp file that corresponds to that
command.
2) Click on a "What's This" icon and then pull down the menu and choose the command he wants and also automatically go to the desired page in the WinHelp file.

After going over info from MSDN and some other reference material, I've accomplished #1 but not #2.

Okay, so I've given every help topic a HelpContextID in the WinHelp file and then used code like that which follows to assign that ID to each menu command:
Code:
' help context ID for menus:
mnuFileNew.HelpContextID = 1001
mnuFileOpen.HelpContextID = 1002
mnuFileSave.HelpContextID = 1003
mnuFileSaveAs.HelpContextID = 1004
mnuEditWholePage.HelpContextID = 2003
mnuEditClearScreen.HelpContextID = 2004
mnuEditFakes.HelpContextID = 2008
mnuEditCut.HelpContextID = 2009
mnuToolsPreview.HelpContextID = 3002
mnuToolsOptions.HelpContextID = 3001
mnuHeadH1.HelpContextID = 4000
mnuHeadH2.HelpContextID = 4000
mnuHeadH3.HelpContextID = 4000

With this, goal #1 is accomplished. Goal #2 is proving more elusive, however. In my "What's This?" menu command, I put this code:
Code:
Private Sub mnuHelpWhatsThis_Click()
    Me.WhatsThisMode
End Sub

That works for changing the mouse pointer into a question mark/arrow (and I assume I can simply call that menu command from the toolbar once I've put a "what's this" icon in there). I thought that since WhatsThisMode would be true when "mnuHelpWhatsThis_Click" was clicked, I could simply do the following for the other menu commands:
Code:
If WhatsThisMode = True Then
    mnuEditWholePage.ShowWhatsThis
End If
No can do. The mouse pointer changes to the "what's this" state, but as soon as I click on any menu, it changes back to normal. If I pull down the menu that contains my if/then statement, VB complains about an unexpected function or variable. I've been looking up "WhatsThisMode," "ShowWhatsThis," "WhatsThisButton," and other commands in my references, but haven't figured this out. What am I doing wrong?

Note: I want the user to be taken to the standard page in the WinHelp file rather than to be shown a yellow popup. I appreciate any help.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top