DevX Skillbuilding for IBM DeveloperWorks
DevX Skillbuilding for IBM DeveloperWorks
DevX Skillbuilding for IBM DeveloperWorks
Get regular email alerts when we publish new features!
DevX Update for IBM developerWorks

More Newsletters
Binding DB2 Tables and Views to Visual Basic WinForms (cont'd)

Step 5: Linking the ManageEmployees form

To link the ManageEmployees form, follow these steps:

  1. Right click on the ManageEmployees project form and select the View Code pop-up menu entry. This should open the form's code view.
  2. Insert the following subroutine:

        Public Sub ShowMe()
            Me.Show()
        End Sub 

  3. Right click on the Main project form and select View Designer pop-up menu entry. This should open the form's designer view.
  4. From the Toolbox - Windows Forms, drag a button control and drop it on the Main form.
  5. Select the new button.
  6. In the Properties dialog, specify the value btnManageEmployees for the Name property.
  7. In the Properties dialog, specify the value Manage Employees for the Text property.
  8. Double click on the btnManageEmployees button. This should open the code view.
  9. In the btnManageEmployees_Click subroutine, type the following code:

            frmManageEmployees.ShowMe()

  10. Save the project.
Previous Page: Step 4: Linking the ViewEmployees form  
Page 1: Step 1 : Create the Visual Basic project Page 4: Step 4: Linking the ViewEmployees form
Page 2: Step 2 : Adding the project forms Page 5: Step 5: Linking the ManageEmployees form
Page 3: Step 3: Setting up the main project form