VISUAL BASIC_6
 

8. Project using Multiple Forms


Creating Forms:

The fourth form is check.frm.   It contains two check boxes, one text box and two command buttons and one label.    They are captioned and positioned as shown in the figure 4.    The codes are entered in the code window as shown in the figure 4a.

 

                               Figure 4                              

Private Sub chkBold_Click()

' The Click event occurs when the check box changes state.

' Value property indicates the new state of the check box.

    If chkBold.Value = 1 Then     ' If checked.

        txtDisplay.FontBold = True

    Else                          ' If not checked.

        txtDisplay.FontBold = False

    End If

End Sub

            

Private Sub chkItalic_Click()

' The Click event occurs when the check box changes state.

' Value property indicates the new state of the check box.

    If chkItalic.Value = 1 Then     ' If checked.

        txtDisplay.FontItalic = True

    Else                          ' If not checked.

        txtDisplay.FontItalic = False

    End If

End Sub

 

Private Sub cmdClose_Click()

   Unload Me    ' Unload this form.

End Sub

 

              Figure 4a

     Save the Project and run the same and examine the output obtained in each of the forms.


 

Copyright © 2001 Selfonline-Education. All rights reserved.