0% found this document useful (0 votes)
28 views

Font Effect

This document contains code for a form with checkboxes and radio buttons that change the formatting and colors of textboxes on the form. Checkbox1 toggles the background color between Azure and Bisque. Checkbox2 toggles the font style to italic and the background between BlueViolet and BurlyWood. Checkbox3 toggles the font style to underline and the background between Crimson and CadetBlue. The radio buttons change the foreground color of the textboxes to either BlueViolet, HotPink, or Magenta.

Uploaded by

Judy cheptoo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Font Effect

This document contains code for a form with checkboxes and radio buttons that change the formatting and colors of textboxes on the form. Checkbox1 toggles the background color between Azure and Bisque. Checkbox2 toggles the font style to italic and the background between BlueViolet and BurlyWood. Checkbox3 toggles the font style to underline and the background between Crimson and CadetBlue. The radio buttons change the foreground color of the textboxes to either BlueViolet, HotPink, or Magenta.

Uploaded by

Judy cheptoo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form1

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox1.CheckedChanged
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Bold)
TextBox2.Font = New Font(TextBox1.Font, FontStyle.Bold)
If CheckBox1.Checked = True Then

Me.BackColor = Color.Azure
Else
Me.BackColor = Color.Bisque
End If
End Sub

Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox2.CheckedChanged
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Italic)
TextBox2.Font = New Font(TextBox1.Font, FontStyle.Italic)

If CheckBox1.Checked = True Then


Me.BackColor = Color.BlueViolet
Else
Me.BackColor = Color.BurlyWood
End If
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CheckBox3.CheckedChanged
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Underline)
TextBox2.Font = New Font(TextBox1.Font, FontStyle.Underline)

If CheckBox1.Checked = True Then


Me.BackColor = Color.Crimson
Else
Me.BackColor = Color.CadetBlue
End If

End Sub

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.ForeColor = Color.BlueViolet
TextBox2.ForeColor = Color.BlueViolet

End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles RadioButton2.CheckedChanged

TextBox1.ForeColor = Color.HotPink
TextBox2.ForeColor = Color.HotPink
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox1.ForeColor = Color.Magenta
TextBox2.ForeColor = Color.Magenta

End Sub
End Class

You might also like