HelpContextID
HelpContextID is a property of all of the controls that can gain focus, and it provides the link between the control and its matching Help topic for context-sensitive help. All three of the help engines—DOS, WinHelp and HTML Help—recognize and use the context IDs.
Usage |
nID = Object.HelpContextID oObject.HelpContextID = nID |
Menus lack a facility for adding HelpContextIDs to developer-created pads and bars. |
For VFP 6, some, but not all, of the built-in pads lose their context IDs as well. Create a quick menu and run it. Press Shift+F1 and select Edit | Paste from the menu, and Help is gone. SET SYSMENU TO DEFAULT and repeat the steps, and it's back. We suspected at first that only pads relevant to the runtime would have their HelpContextIDs preserved, but that doesn't seem to be the case, either. As we mention in the menu sections, this part of Visual FoxPro is in serious need of an overhaul. This is even more true in VFP 7, where Shift+F1 and selecting any menu item brings up Help, but does not bring up any topic. While we've lost functionality, we can take consolation in the fact that the system menus now behave just like user-defined menus—no context-sensitive help for anybody. |
Example |
* We've created a help file where we want a standard * "this is what happens if you select quit" help topic. * We've assigned that topic HelpContextID 37 in the HLP file. * In each of the forms where we want that help, we * assign the topic to the associated buttons: oForm.btnQuit.HelpContextID = 37 && Standard 'Quit' help * Actually, we can do this just once if we make it part of a * quit button class. |
See Also |