21 Write a Vb program to design form Display in the picture box.


Private Sub Command1_Click()
If Option1(0).Value Then
Text1.ForeColor = vbRed
Text2.ForeColor = vbRed
ElseIf Option1(1).Value Then
Text1.ForeColor = vbGreen
Text2.ForeColor = vbGreen
ElseIf Option1(2).Value Then
Text1.ForeColor = vbBlue
Text2.ForeColor = vbBlue
Else
Text1.ForeColor = vbBlack
Text2.ForeColor = vbBlack
End If
If Check1.Value = 1 Then
Text1.Font.Bold = True
Text2.Font.Bold = True
Else
Text1.Font.Bold = False
Text2.Font.Bold = False
End If
If Check2.Value = 1 Then
Text1.Font.Italic = True
Text2.Font.Italic = True
Else
Text1.Font.Italic = False
Text2.Font.Italic = False
End If
If Check3.Value = 1 Then
Text1.Font.Underline = True
Text2.Font.Underline = True
Else
Text1.Font.Underline = False
Text2.Font.Underline = False
End If
End Sub

Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
For i = 0 To 3
Option1(i).Value = False
Next
Picture1.Picture = LoadPicture(“”)

End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Image1_Click()
Picture1.Picture = Image1.Picture
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s