0

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 by danattheville: n/a

1
Contributor
1
Reply
3
Views
6 Years
Discussion Span
Last Post by danattheville
0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.