Home > Basic Functions > ccc xc > Windows Applications > Windows Form Help Button
Windows Form Help Button
You can add a help button, icon or hyperlink to a form within your Windows application that opens a specific page of your help system. Follow the steps below to add a help button to your Visual Studio 2003/2005 Windows application.
1. Open a form (such as a login form) within your Visual Studio Windows application.
2. Double click the 'Button' control to add a button to the form. Change the 'text' property to 'Help'. Drag the button to the desired position.
3. Double click the button control to open the code window.
4. Add the following code to the "Sub Button1_Click" event:
Open a Dynamic Help Page (page only, no contents)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Help.ShowHelp(Button1, "http://www.extremeease.com/help/helpconsole 2008/page.aspx?pageid=Project_Login") End Sub |
Open a Dynamic Help Page (within help system)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Help.ShowHelp(Button1, "http://www.extremeease.com/help/helpconsole 2008/default.aspx?pageid=Project_Login") End Sub |
Open a Static Help Page
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Help.ShowHelp(Button1, "help\project login.htm") End Sub | * the url above assumes that the help system is in a sub folder named 'help'
Open a Static Help Page (within help system)
* Note: a page parameter cannot be passed when a static help system is opened from Visual Studio, so in order to display a specific page within the help system, the static help system must be created without frames. See Publishing a Static Help System for more information.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Help.ShowHelp(Button1, "help\project login.htm") End Sub |
ShowHelp Syntax: Help.ShowHelp(Parent, URL) Parent - Name of the button control URL - The url of the help system
5. Press F5 to run the application. Click the 'Help' button.
See also
|