c# - Making a button click when pressing enter instead of clicking the control -


i'm trying make button called btnsubmit submit customer's information if hit enter on keyboard. know in vs2012 if i'm coding strictly c#, can change properties , set button activated when enter pressed.

because coding in .net c#, not have option control. advice coding? can't find anything.

i working web form.

i think trick.

don't attempt trigger button click. should refactor code event handlers separated actual implementation. e.g.

void form_keydown(object sender, keyeventargs e) {     if (e.keycode == keys.enter)     {         checkanswer();     } }  public void button1_click(object sender, eventargs e) {     checkanswer(); }  private void checkanswer() {     // stuffs on button click  } 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -