Press Enter key in VB.Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Please let me know how I could move from one field to another on a form by
using the "Enter" key. I would like to use the enter key in a datagrid as
well. If you are replying with code please use vb.net.

Your help will be greatly appreciated.

Regards.
 
Prepi,

You can use the keyup event to test if it was an enter key that has been
pushed and than set the focus on the next control using the
selectnextcontrol method.

For a datagrid it is completly different, there it would be automaticly, see
this to prevent that.
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q791q

I hope this helps,

Cor
 
Thanks Cor. I will try the KeyUp method. However, with the datagrid, I cannot
get the Enter key to move to the next cell. The code in the link is in some
other language ( "C" I think) and hence I do not understand it.

Regards.
 
Back
Top