0% found this document useful (0 votes)
4 views4 pages

Appearance and Style

The document outlines a Visual Basic program aimed at changing the color, font, and size of text. It includes various subroutines for selecting different font types, colors, sizes, and styles. The program successfully executes the intended functionality as described in the output section.

Uploaded by

rehna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Appearance and Style

The document outlines a Visual Basic program aimed at changing the color, font, and size of text. It includes various subroutines for selecting different font types, colors, sizes, and styles. The program successfully executes the intended functionality as described in the output section.

Uploaded by

rehna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Ex.No.

CHANGING THE COLOR, FONT AND SIZE OF TEXT

Aim:
To write a Program using Visual Basic to change the color, font and size of
the text.

Form Design:

Program Coding:

Font Type
Private Sub Option5_Click()
Text1.FontName = "MS Sans Serif"
End Sub

Private Sub Option6_Click()


Text1.FontName = "Impact"
End Sub

Private Sub Option7_Click()


Text1.FontName = "Niagara Engraved"
End Sub

Private Sub Option8_Click()


Text1.FontName = "Calibri"
End Sub

Private Sub Option9_Click()


Text1.FontName = "Arial"
End Sub

Font Color
Private Sub Option1_Click()
Text1.ForeColor = vbRed
End Sub

Private Sub Option2_Click()


Text1.ForeColor = vbYellow
End Sub

Private Sub Option3_Click()


Text1.ForeColor = vbBlue
End Sub

Private Sub Option4_Click()


Text1.ForeColor = vbGreen
End Sub

Font Size

Private Sub Option10_Click()


Text1.FontSize = 10
End Sub

Private Sub Option11_Click()


Text1.FontSize = 12
End Sub

Private Sub Option12_Click()


Text1.FontSize = 14
End Sub

Private Sub Option13_Click()


Text1.FontSize = 16
End Sub

Font Style
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1.FontBold = True
Else
Text1.FontBold = False
End If
End Sub

Private Sub Check2_Click()


If Check2.Value = 1 Then
Text1.FontItalic = True
Else
Text1.FontItalic = False
End If
End Sub

Private Sub Check3_Click()


If Check3.Value = 1 Then
Text1.FontUnderline = True
Else
Text1.FontUnderline = False
End If
End Sub

Private Sub Check4_Click()


If Check4.Value = 1 Then
Text1.FontStrikethru = True
Else
Text1.FontStrikethru = False
End If
End Sub

OUTPUT:
Result:
Thus the program “changing the font, color, size of text” has been successfully executed.

You might also like