Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > question regarding tabs
 

question regarding tabs

like once if enter some value in text box which accepts a maximum of 5 characters once if i finished entering the maximum sieze of 5 length value the cursor focus should be moved to next control automaticaly

can u pelase help me with this thank you

chaitu2  Thursday, August 02, 2007 10:56 PM

Hi kranthi4uonly,

Handle the TextBox.TextChanged event,usethe SendKeys.Sendto simulate pressingTAB key. Try something like the following:

Code Snippet

private void textBox1_TextChanged(object sender, EventArgs e)

{

TextBox tb = (TextBox)sender;

if (tb.Text.Length == tb.MaxLength)

{

SendKeys.Send("{TAB}");

}

}

Hi kranthi4uonly,

Handle the TextBox.TextChanged event,usethe SendKeys.Sendto simulate pressingTAB key. Try something like the following:

Code Snippet

private void textBox1_TextChanged(object sender, EventArgs e)

{

TextBox tb = (TextBox)sender;

if (tb.Text.Length == tb.MaxLength)

{

SendKeys.Send("{TAB}");

}

}

You can use google to search for other answers

Custom Search

More Threads

• Where is the code?
• Populate SQL values into a combobox as a list of items.
• DataGridView bounded to List of custom objects, what property attribute sets the datagridview column edit control
• Can't hide first column in DataGridView
• update question
• Scaning an item to grid after 15 to 20 item scanned page is crashing
• DataGridView to SQL database in C#
• Moving Up/Down Rows ?
• Bug on focus lost - System.Windows.Forms.ContainerControl.ValidateThroughAncestor
• Sum column by header name and get average