vb example form design

 FORM DESIGN - 







CODE VIEW -


Private Sub cmdBlack_Click()
    Form1.BackColor = vbBlack              'THIS PROGRAM TEACHES YOU TO SET PROPERTIES IN RUN-TIME
                                        'Form1 is the OBJECT, BackColor is the PROPERTY, vbBlack is VALUE
End Sub

Private Sub cmdChangePosition_Click()
    Form1.Top = 5000
    Form1.Left = 5000
End Sub

Private Sub cmdDefault_Click()
    Form1.BackColor = &H8000000F         'This is the Hexa-decimal color code
    Form1.Width = 4500
    Form1.Height = 4125
    Form1.Top = 900                     'You can also set these properties in DESIGN TIME
    Form1.Left = 900
End Sub

Private Sub cmdEnlarge_Click()
    Form1.Width = 5160
    Form1.Height = 4770
End Sub

Private Sub cmdGreen_Click()
    Form1.BackColor = vbGreen                 'vbGreen is a VB CONSTANT
End Sub

Private Sub cmdMakeSmaller_Click()
    Form1.Width = 4500
    Form1.Height = 4125
End Sub

Private Sub cmdRed_Click()
    Form1.BackColor = vbRed
End Sub


Private Sub cmdWhite_Click()
    Form1.BackColor = vbWhite
End Sub

Private Sub Form_Load()
    Form1.Top = 900
    Form1.Left = 900
End Sub





Comments

Popular posts from this blog

Computer Mcq Part 1 (1-50)

Computer MCQ Part 4 (151-200)

Computer MCQ Part 3 (101-150)