Displaying Text Files

The Display Help button displays the content of a file named Help.txt. Perform the following steps to add this text file to your current project:

  • Right-click on the project name in Solution Explorer and select Add -> New Item.

  • Select the Text File template and name it "Help.txt."

  • Put some text into Help.txt.

Code the Display Help button as follows:

'===================================================
    ' Display Help
    '===================================================
    Private Sub btnDisplayHelp_Click( _
       ByVal sender As System.Object, _
       ByVal e As System.EventArgs) _
       Handles btnDisplayHelp.Click
        MsgBox(My.Computer.FileSystem.ReadAllText("Help.txt"))
    End Sub

Get Use ClickOnce to Deploy Windows Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.