I am trying to write a program that will allow a user to use a button to toggle the color or the text in a text box between blue and green. Any ideas?

Here is what I have so far:

[Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
if
TextBox1.ForeColor = Color.DarkRed
Else
TextBox1.ForeColor = Color.Blue
End If

End Sub]

Edited 5 Years Ago by danattheville: n/a

I am trying to write a program that will allow a user to use a button to toggle the color or the text in a text box between blue and green. Any ideas?

Here is what I have so far:

[Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
if
TextBox1.ForeColor = Color.DarkRed
Else
TextBox1.ForeColor = Color.Blue
End If

End Sub]

Figured it out... here it is...

If TextBox1.ForeColor = Color.Red Then
TextBox1.ForeColor = Color.Black
Else
TextBox1.ForeColor = Color.Red
End If

This question has already been answered. Start a new discussion instead.