Radio Button code in vb with Forecolor.
Radio Button Checked Property.
Public Class Form1
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked Then
RadioButton1.ForeColor = Color.Red
Else
RadioButton1.ForeColor = Color.Blue
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked Then
RadioButton2.ForeColor = Color.DeepPink
Else
RadioButton2.ForeColor = Color.Blue
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked Then
RadioButton3.ForeColor = Color.Black
Else
RadioButton3.ForeColor = Color.Blue
End If
End Sub
End Class
Radio Button Checked Property.
Public Class Form1
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked Then
RadioButton1.ForeColor = Color.Red
Else
RadioButton1.ForeColor = Color.Blue
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked Then
RadioButton2.ForeColor = Color.DeepPink
Else
RadioButton2.ForeColor = Color.Blue
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked Then
RadioButton3.ForeColor = Color.Black
Else
RadioButton3.ForeColor = Color.Blue
End If
End Sub
End Class
0 comments: