TextBox event change when textlength is zero

J

Jeff

I have a form I want to clear two other fields if the length of the text
box is zero.

ie.

TextBox1 has 11111
TextBox2 has 22222
TextBox3 has 33333

When the user tabs to TextBox1 the text of 11111 is highlighted. the
user presses a key to change this text. At this point I need to clear
TextBox2 and TextBox3.

What is the best way to achieve this.
 
C

Code Monkey

One might do the following:

<code>

if(String.IsNullOrEmpty(TextBox1.Text))
{
TextBox2.Text = null;
TextBox3.Text = null;
}

</code>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top