Question

In VB.NET, Windows form details should save. If I press the Enter key, it should save and close and the escape key should close without save.

Currently it happens on the 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.

Was it helpful?

Solution

Set the AcceptButton and CancelButton properties on your form.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top