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 4: Linking the ViewEmployees form

To link the ViewEmployees form, follow these steps:

  1. Right click on the ViewEmployees 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, drag a button control and drop it on the Main form.
  5. Select the new button.
  6. In the Properties dialog, specify the value btnViewEmployees for the Name property.
  7. In the Properties dialog, specify the value View Employees for the Text property.
  8. Double click on the btnViewEmployees button. This should open the code view.
  9. In the btnViewEmployees_Click subroutine, type the following code:

     frmViewEmployees.ShowMe()

  10. Save the project.
Previous Page: Step 3: Setting up the main project form Next Page: Step 5: Linking the ManageEmployees 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