Sir, I have about 20 textBoxe ,10 comboBox and 5 dateTimePicker in a form.
as I want to go cursor downward through each textbox whenever I press 'Enter' Key.
I coded:-
if(e.KeyCode==Keys.Enter)
{
txtLastName.Focus()// goes from txtFirstName to txtLastName
}
I am tired of writing this code in each textBox of my form.
is there an unique code to define these function in a form, i.e keydown event defines for 25 textboxes.?
Loading

Sanjeeb LenkaPosted Jul 3, 2013, 12:59 AM
http://stackoverflow.com/questions/5605561/navigation-in-windows-forms-using-enter-key
Kunal VaishyaPosted Jul 3, 2013, 12:43 AM
SUNIL GUTTAPosted Jul 2, 2013, 3:55 PM
As you are dealing with enter key i.e we have 2 create a event handler for it and go proceed using foreach loop with sender(un-boxng) & focus method for next textbox in orderly fashion ..
Jignesh TrivediPosted May 29, 2013, 11:08 PM
hi,
Please refer followinf link it might help you.
http://www.codeproject.com/Articles/13109/Redirect-the-Enter-key-from-a-Windows-Forms-TextBo
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.selectnextcontrol%28v=vs.100%29.aspx