Hi CSharp Good Guys,
Need your help. Please help me. I am using C#Net2008 for Window application.
On the FORM there are 14 TextBox Controls. The Users are requesting that after data input in a textbox, they press ENTER key they expect the cursor to move to the next TextBox whose TabIndex is just 1 greater than the current one. So far, the TAB key does work but ENTER key is not.
Please share your suggestion with me and if possible share with me a sample coding. I rather learn and understand coding logic.
Thank You.
Loading
Sam HobbsPosted Apr 16, 2010, 6:41 PM
Sam HobbsPosted Apr 16, 2010, 6:37 PM
Sam HobbsPosted Apr 15, 2010, 5:06 PM
If you need to not advance for some controls, then we need to add logic to that function for that. For example, if the current control (the control with focus) is a button, and if you want the enter key to click the button as normally happens, then we need to add logic for that.
Also, if the form has an Okay button then the ProcessCmdKey can prevent the enter key from doing the equivalent of clicking the Okay button. This might be an advantage or a disadvantage, but I assume that if it is intended that the enter key be equivalent to clicking the Okay button, then that can be done too.
Jaish MathewsPosted Apr 15, 2010, 8:55 AM
Do below things
if (e.KeyCode.Equals(Keys.Enter))
{
SendKeys.Send("{TAB}");
}
Just programmatically firing a TAB key, once enter press. If your TAB correct, this will work.