ARTICLE

HelpProvider Control with HelpClass in VB.NET

Posted by Dea Saddler Articles | ASP.NET using VB.NET March 24, 2011
In this article we demonstrate on what is HelpProvider control and HelpClass and also the additional properties the HelpProvider control provide to other control when add to a form
Download Files:
 
Reader Level:

A visual basic HelpProvider control allow us to provide help for controls on the form when F1 key is pressed. The HelpProvider control is extender which means that it coordinates and maintains properties for each controls on the form. Notable property of HelpProvider control is HelpNameSpace property which specifies the URL for the help file associated with it. The HelpProvider control Provide three additional properties to each control on the form.


Properties of HelpProvider Control:-

  • HelpString:- This property shows help string associated with a control. 

  • HelpKey:- This property shows help keyword associated with a control

  • HelpNavigator:- This property shows the kind of help associated with a control.
     

HelpClass:-

HelpClass allow you to display a HTML help to user. HelpClass provide two methods ShowHelp and ShowHelpIndex. Here we are showing an example of HelpProvider control with HelpClass file. In which you have two Buttons, a Label, HelpProvider control and one work. Html file in c drive of your system.The below code display a help string when Button2 has the Focus and F1 key pressed and a help file when Button1 is clicked.

  • Open a new Project. 

  • Drag Two Buttons, a Label and a HelpProvider Control on form, the form will look like given below.

    HelpProvider.gif

    HelpProvider2.gif

  • Write the below code on form load and Button click.

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As  _
            System.EventArgs) Handles MyBase.Load
            HelpProvider1.SetHelpString(Button2, "I am supported by HelpProvider1")
            'button2 needs to have focus to display this string when F1 is pressed
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e_ As System.EventArgs) Handles
           
    Button1.Click
            Help.ShowHelp(Label1, "C:\work.htm")
            'using the Help class with label control
        End
    Sub

    Output:-

    HelpProvider4.gif
    HelpProvider3.gif


    HelpProvider5.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Diagram
Become a Sponsor