Help Support for Visual Basic 6.0 Users
This topic compares support for implementing help in Visual Basic 6.0 with its equivalent in Visual Basic 2008.
Most applications provide help for users in the form of a Help file, pop-up Help, and / or ToolTips. While both Visual Basic 6.0 and Visual Basic 2008 support all three Help mechanisms, the methods of implementing them differ considerably.
In Visual Basic 6.0, Help could be provided using either HTML Help or the older Windows Help format. In Visual Basic 2008, only HTML Help is supported.
Help support in Visual Basic 6.0 was implemented on a per-project basis by specifying a Help file name in the Project Properties dialog box. Each form and control had a HelpContextID property that could be used to link to a specific topic in the Help file.
Help support in Visual Basic 2008 is implemented on a per-form basis by adding one or more HelpProvider components to a form. Each form and control has HelpKeyword and HelpNavigator properties that were used to link to a specific topic. For more information, see How to: Provide Help in a Windows Application.
Pop-up Help in Visual Basic 6.0 was implemented using the WhatsThisButton and WhatsThisHelp properties of a form. The What's This button appeared if WhatsThisButton was True and both the MaxButton and MinButton properties were False. Setting the WhatsThisMode property in code enabled the button.
Pop-up Help in Visual Basic 2008 is implemented using the HelpButton property of a form. The Help button only appears if the HelpButton property is set to True and both the MaximizeBox and MinimizeBox properties are set to False; the button is automatically enabled. For more information, see How to: Display Pop-up Help.
ToolTips in Visual Basic 6.0 were implemented using the ToolTipText property of a control.
In Visual Basic 6.0, Help could also be displayed using a ShowHelp method of a CommonDialog control to open Windows Help. Windows Help is no longer supported in Visual Basic 2008 and there is no equivalent control for displaying Help.
The following code illustrates the differences in coding techniques between Visual Basic 6.0 and Visual Basic 2008 for some common uses of Help properties.
Specifying a Help file
The following example demonstrates how to specify a Help file for your application, assuming that your form has two OptionButton controls that allow the user to choose between English and French Help files.
' Visual Basic 6.0
If Option1(0).Value = True Then
App.HelpFile = App.Path & "\EnglishHelp.chm"
App.HelpFile = App.Path & "\FrenchHelp.chm"
' Visual Basic ' Assumes a HelpProvider component has been added to the form. If RadioButton1.Checked = True Then HelpProvider1.HelpNamespace = My.Application.Info.DirectoryPath & _ "\EnglishHelp.chm" Else HelpProvider1.HelpNamespace = My.Application.Info.DirectoryPath & _ "\FrenchHelp.chm" End If
Displaying a ToolTip
The following demonstrates code to display a ToolTip.
' Visual Basic 6.0
Private Sub Text1_Change()
Text1.ToolTipText = "The text has changed"
Visual Basic 6.0
Visual Basic 2008
No equivalent. Enabled by default.
When a Visual Basic 6.0 project is upgraded using the upgrade wizard in Visual Basic 2008, any Help-related properties or code will not be upgraded. You need to reimplement Help support for your application after upgrading. If your Help file was written using HTML Help, you can reuse the Help file; if it was written using Windows Help it will need to be rewritten.