Carlos Sanchez

Carlos Sanchez

  • NA
  • 264
  • 0

CancelButton Property of the Form

Jul 10 2004 11:10 AM
I'm doing a classic Windows Application in C#, I just want to add a record in a Table. Well, I Have a form with several TextBoxes and six 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 the TextBoxes are Enabled and I press Esc (The Esc key of the keyboard) the TextBoxes are not enabled like I had clicked Cancel. Then, tried 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 because a I've a Exit Button. Somebody can help me. What can I do? Thanking you in advance.

Answers (2)