Search code examples
c#winformskeyboard-eventsuicomponents

Keyboard Actions on UIC - C#


i have a login form

alt text
(source: deviantart.net)

what i want is that after i have filled the password field when i press "Enter", it performs some action, some set of lines of code, in my case the same that the "Login button does". how to do it


Solution

  • Add an eventhandler for keypress on the password textbox, in that eventhandler you check for the enter key, and call the (eventhandler) method that the login button is bound to.