tutlogger

How to Add a Help File on VB.Net




In my previous post, I discussed a step by step tutorial on how to create a help file using the Microsoft HTML Help Workshop. ( Before you proceed reading this post, I urge you to read first  the article on how to create a help file by clicking here.). But if you already know how to make a help file, you may also want to know how to add a help file on VB.Net

Including a help file in a software program you develop will serve as a guide for the users to understand the features of your program and how do they work. In case a user do not know how and where to search records in your program, including a help file topic about how to search record may help the user.

In this tutorial, I will teach you how to add a help file in your Visual Basic project. Here's how to do it.

Step 1. Create your Help File project using the Microsoft HTML Help Workshop. Click here if you want to know how.


Step 2. After creating your Help File project, go to the root folder directory where your Help File project has been saved. Copy all the file inside by copying the root folder.




Step 3. Open your Visual Basic project folder and navigate to Project folder name > Bin >> Debug. Paste the Help File project folder inside Debug folder.




Step 4. Open your Visual Basic project. Create a new class.
(To add a class, right click to your project name on the Solution Explorer window > expand Add >> then click Class). 




Name the class as HTMLHelpClass and paste the code shown below inside this class after the Public Class HTMLHelpClass. 

   Private Shared HelpNamespaceValue As String
    Shared Property HelpNamespace() As String
        Get
            Return HelpNamespaceValue
        End Get
        Set(ByVal value As String)
            HelpNamespaceValue = value
        End Set
    End Property

    ' GetLocalHelpFileName() returns the full filename with path
    ' to the help file located in the same directory with the
    ' compiled EXE file
    Shared Function GetLocalHelpFileName(ByVal FileName As String) As String
        Dim ExeName, DirName, HelpFileName As String
        ExeName = Environment.GetCommandLineArgs(0)
        DirName = System.IO.Path.GetDirectoryName(ExeName)
        HelpFileName = DirName + "\" + FileName
        Return HelpFileName

    End Function

Step 5. Go to your main form, grab a menu strip from your project toolbox (if you can't find your toolbox just go to View > Toolbox) and add Help as a menu. Under Help menu > add User's Manual sub-menu. 




Step 6. Double click  User's Manual sub-menu or right click and view code, then paste this code:

Help.ShowHelp(Me, HTMLHelpClass.HelpNamespace, HelpNavigator.TableOfContents, "")

Ok. That's all, you now have a compiled chm Help File in your Visual Basic project.



SHARE THIS POST

1 comment:

  1. When it comes to finding the Best Forex Trading Platform in India, Winprofx stands out as a reliable and powerful choice for both beginner and advanced traders. Designed with Indian traders in mind, Winprofx offers a seamless, user-friendly interface combined with lightning-fast execution and deep market insights, making it the perfect platform to navigate the dynamic world of forex trading in 2025. With access to real-time data, advanced charting tools, and low spreads, Winprofx helps users make smarter trading decisions with confidence. What sets it apart is its strong focus on education and mentorship, ensuring traders are not only trading but also learning and growing with every move. Whether you're trading major pairs like EUR/USD or exploring exotic currencies, Winprofx gives you access to a wide range of assets, reliable customer support, and risk management tools. For Indian traders who want a globally competitive edge with local support, Winprofx is the ultimate platform that blends technology, transparency, and training. In a market filled with promises, Winprofx delivers performance. Start your forex journey today with Winprofx and experience why it’s being recognized as the Best Forex Trading Platform in India for 2025.


    Best Forex Trading Platform in India-




    ReplyDelete

PRIVACY POLICY | TERMS OF SERVICE | COPYRIGHT POLICY