need help in changing colour of alphabets

Jali

Member
Joined
Mar 16, 2010
Messages
5
Programming Experience
Beginner
if i have ten textbox. in each with different a b c d e f g h i.. i want to retype it and the colour wil change. lets say i backspace a and when i retype it will change to green.
 
try this:

So let me get this right, if the text box is EMPTY, change the color for the next time.

ok try this:

VB.NET:
    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If TextBox1.Text = "" Then

            If TextBox1.ForeColor = Color.Red Then
                TextBox1.ForeColor = Color.Green
            Else
                TextBox1.ForeColor = Color.Red
            End If
        End If
 
Back
Top