Microsoft Office Tutorials and References
In Depth Information
Adding Controls to a UserForm
The caption of a Frame control is an efficient way to describe the purpose of the Frame, just as the
Label’s caption of “Employee Name” describes the purpose of the TextBox. In Figure 18-12, the
Caption property of your new Frame is selected in order to change the meaningless default caption
of “Frame1” to a more useful description.
In Figure 18-13, the Frame’s default caption of “Frame1” has been changed to “Position Title.” Now
that the Frame’s caption is taken care of, Figure 18-13 also shows that the OptionButton icon in the
Toolbox is about to be selected. Because an employee would hold only one particular job position
title at a time, a series of OptionButtons can be arranged inside the Frame to represent the
company’s various position titles, where only one can be selected.
In this basic UserForm example, Figure 18-14 shows four position titles from which to choose,
each as a caption among the four OptionButton controls that were placed inside the Frame. The
OptionButtons were added and captioned one at a time. Planning ahead, Figure 18-14 also shows
the CommandButton icon in the Toolbox, which is about to be selected in order to add a couple of
buttons as the last step in building the UserForm’s front-end design.
In Figure 18-15, two CommandButtons have been added, which completes the UserForm’s interface
design. One of the CommandButtons is captioned OK, which is a common and intuitive caption for
users to click their confirmation of data entries. The other CommandButton is a Cancel button to
allow users to quit the UserForm altogether, if they so choose.