Custom dialog boxes Unit objectives Add a user form to your project and add controls to that user form Handle events attached to controls in a user form and validate the data entered by users
Topic A Topic A: User forms Topic B: Events
The UserForm window UserForm window Toolbox
Activity A-1 Adding a user form
Controls in Toolbox Label - displays text on a user form TextBox - accepts data from users CommandButton - performs actions ListBox - displays a list of values CheckBox - indicates if an option is selected or not OptionButton - represents a single option in a group ComboBox - a combination of a list box and a text box
Adding controls to a form
Adding controls to a user form Activity A-2 Adding controls to a user form
Adding controls to a user form (Movie)
Topic B Topic A: User forms Topic B: Events
UserForm object events Activate Deactivate Click DblClick Initialize Terminate
Common control events Change Click DblClick BeforeUpdate AfterUpdate
Attaching an event handler to a control Activity B-1 Attaching an event handler to a control
Validating data by using event handlers Activity B-2 Validating data by using event handlers
Unit summary Learned how to create a user form and add controls to it Learned how to handle events attached to controls and validate data entry