Click here to Skip to main content
14,639,666 members
Rate this:
Please Sign up or sign in to vote.
See more:
HI All,

I am using dotnet framework 4.0 and asp.net and C#. My question is "when user navigates from one text box to another text box by pressing tab automatically the the navigated text box color should change" for this plz help me to solve this problem.


Thanks in advance..
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

In the text-box's on-focus event use the background color property and give a color of Your choice.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Write code on the LostFocus event of the first textbox.

For e.g.
textbox1_LostFocus(sender e, LostFocusEventArgs e)
{
  if (textbox1.text.Length == 0)
  {
     textbox1.Background = Color.Yellow;
  }
}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100