Controlling Events

A control might be a text box, a command button, or a menu. Visual Basic supports many controls that you can put on a form, and these controls appear in the toolbox window.

Every control that you place on a form supports one or more events. For example, if you place a text box in the center of the Form window and run the program, you can click the text box, enter text in the text box, or ignore the text box. The text box control supports events that can recognize when you do anything to that control.

If you've written an event procedure for the text box event that occurs, your code's instructions will execute automatically as soon as the event occurs. Therefore, if you've written code to blank out the text box as soon as the ...

Get Absolute Beginner's Guide to Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.