Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Control Events

Every control 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, double-click the text box, and ignore the text box. The Text Box control happens to support events that can recognize when you've done anything to the control.

If you've written an event procedure for that text box's event, 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 user clicks the text box and you've written another event procedure for the double-click event that fills the text box with Xs when the user double-clicks the text box, the text box fills with blanks or Xs when you run the program and click or double-click the text box.

Share ThisShare This

Informit Network