0
Answer

CancelButton Property

Carlos Sanchez

Carlos Sanchez

20y
1.6k
1
I'm doing a classic Windows Application in C#, I want to add a record in a Table. So, I Have a form with several TextBoxes and Three Buttons: "Add", "Delete", "Search", "Cancel", "Save" and "Exit". Initially, the TextBoxes are not enabled, when I click "Add" they are enabled, when I click "Cancel" they are not enabled again. So, I want when I press Esc (The Esc key) were like I click Cancel, then I set the CancelButton property of the form to "btnCancel" (btnCancel is the name of the Cancel Button), but when a press Esc the form is closed and I don't want that. Somebody can help me. What can I do?