views:

103

answers:

1

In vb dot net, Windows form details should save if I press enter key should save and close and escape key should close without save

Currently it happens on onclick event of a button of Save and Cancel, but I wish the keyboard events also work

Any quick code to do that is appreciated

+3  A: 

Set the AcceptButton and CancelButton properties on your form.

danbystrom
Beat me to it (and I learnt something new in the process!)
Murph
Thanks It works as expected
Ramji