» Home
» Tutorials
» Search  
» Contact us 

Home » Tutorials » Introduction to Visual Basic .NET » Chapter 6

Chapter 6: Building Windows Applications
6.4: Using Multiple Forms
6.4.1: Help About

Help About

Most applications have an About dialog box that describes the application’s name and copyright information. As you already have a toolbar button for this feature, you’ll want to create this form now.

 

Exercise - Adding an About Box

1. To add a new form to the project, you need to use the Solution Explorer. Right click the Text Editor project and select Add * Windows Form. In the Add New Item Text Editor dialog box, shown in below figure, select the About Box in the Templates pane, enter About.vb in the Name field, and click the Add button to create the new form.

2. When the form’s Designer appears, you’ll notice that all of the normal details that are shown in an About dialog box are already on the form. This includes such items as the product name, version number, copyright information, etc.

3. Right-click the form and choose View Code from the context menu.You’ll notice that the Load event for the form already contains a significant amount of code to populate the details on the About form. There is a TODO comment in the code that informs you that you need to update the assembly information for the application.

4. Right-click the project in the Solution Explorer and choose Properties from the context menu. Click the Assembly Information button in the Application pane of the Text Editor properties to display the Assembly Information dialog box. Edit the information in this dialog box as shown below and then click OK to close this dialog box.

5. You need to write a procedure that will display the About dialog box, so add this code to the TextEditor form:

Public Sub ShowAboutBox()
    ‘Display the About dialog box
    Dim objAbout As New About
    objAbout.ShowDialog(Me)
End Sub

6. Finally, you need to call ShowAboutBox when the Help About button on the toolbar is clicked. In the Class Name combo box at the top of the Code Editor, select tbrHelpAbout and in the Method Name combo box, select the Click event. Add the following highlighted code to the Click event handler:

Private Sub tbrHelpAbout_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles tbrHelpAbout.Click
‘Display the About dialog box
ShowAboutBox()
End Sub

7. Run the project and click on the Help About button. You should see this dialogbox:

 

click next Page - How It Works.

Home | Link to Us | Partner Links | About us | Contact us

Copyright © 2009-2012 F1tutorials.com | All Rights Reserved