Now every users or clients need user friendly application.so when we are working with windows form application it is very difficult to place the cursor manually to diffrents control for diffrents purpose.
Here i am explaining how we can do this automatically using enter key.
- private void txt_invoice_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- txt_date.Focus();
- }
- private void txt_date_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- txt_patientname.Focus();
- }
So here we need Keydown event of textbox control to write the code.