In this exercise, you will learn about a forms CancelButton property, which specifies the button whose Click

Question:

In this exercise, you will learn about a form’s CancelButton property, which specifies the button whose Click event procedure is processed when the user presses the Esc key. Open the VB2015\Chap03\Cancel Solution\Cancel Solution (Cancel Solution.sln) file.

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 btnUndo_Click 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: