|
|
![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
Showing Windows Help From A Visual Basic ProgramYou can display a Windows Help file (.hlp) with the Common Dialog controls ShowHelp method. To use this method, you first set the Common Dialog controls HelpCommand property to one of the following settings, and the HelpFile property to the actual name of the Help file to open. Here are the possible settings for HelpCommand:
Often, you want to open a Help file to its contents page, and so youd set the HelpCommand property to the cdlHelpContents constant. Be careful, however, that constant doesnt work with some Help files (those constructed with the Microsoft Help Workshop Version 4.0X), so check if ShowHelp works properly before releasing your program. The cdlHelpContents constant works with fewer Help files than you might thinkin fact, it wont open the main Windows Help file itself, windows.hlp, correctly. Instead, you must use a special value, &HB:
Private Sub Command1_Click()
CommonDialog1.HelpCommand = &HB
CommonDialog1.HelpFile = "c:\windows\help\windows.hlp"
CommonDialog1.ShowHelp
End Sub
The result of this code appears in Figure 11.13. Here, were opening the Windows main Help file to its contents page.
Our ShowHelp example is a success. The code for this example is located in the helpdialog folder on this books accompanying CD-ROM.
|
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |