Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Properties and Event Procedures

This is a good time to review properties. When the programmer (that's you!) places controls on a form, you generally set many of the control's property values at that time in the Properties window. A programmer can then write the event procedure code for the control, or she might place additional controls on the form and write event procedures later.

Many of the properties in the Properties window show up immediately during design time as you assign the properties. In other words, if you place a command button on a form and immediately click the Properties window's Caption property and type Click Here, the command button instantly reads Click Here in the Form window.

The event procedure code, however, doesn't do anything until runtime. The instructions you learn to place in the event procedures will not execute until the application's user runs the program and triggers events at runtime. The Properties window often reacts at design time, whereas the Code window often reacts at runtime. In a way, the code inside a procedure window works like a cook's recipe: the recipe describes an action that will take place once the cook begins the dish. The program describes what will happen when the program's user executes the program.

Share ThisShare This

Informit Network