Question: 12. In this exercise, you learn about the CancelButton property of a Windows form. Open the Cancel Solution (Cancel Solution.sln) file contained in the VB2012Chap03Cancel
12. In this exercise, you learn about the CancelButton property of a Windows form. Open the Cancel Solution (Cancel Solution.sln) file contained in the VB2012\Chap03\Cancel Solution folder.
a. Open the Code Editor window and review the existing code. Start the application.
Type your first name in the text box and then press Enter to select the Clear button, which is the form’s default button. The Clear button removes your name from the text box. Click the Undo button. Your name reappears in the text box. Click the Exit button.
b. Return to the designer window. Set the form’s CancelButton property to btnUndo.
Doing this tells the computer to process the code in the Undo button’s Click event procedure when the user presses the Esc key. Save the solution and then start the application. Type your first name in the text box and then press Enter to select the Clear button. Press Esc to select the Undo button. Your name reappears in the text box. Close the Code Editor window and then close the solution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
