Adding controls to a User Form

When you activate a UserForm, the VBE displays the Toolbox in a floating window, as shown in Figure 16-3. You use the tools in the Toolbox to add controls to your UserForm. Just click the desired control in the Toolbox and drag it into the dialog box to create the control. After you add a control, you can move and resize it by using standard techniques.

Figure 16-3:

You use the tools in the Toolbox to add controls to a UserForm.

Figure 16-3:

You use the tools in the Toolbox to add controls to a UserForm.

Table 16-1 indicates the various tools, as well as their capabilities. To determine which tool is which, hover your mouse button over the control and read the small pop-up description.

Table 16-1

Toolbox Controls

Control

What It Does

Label

Stores text

TextBox

Allows the user to enter text

ComboBox

A drop-down list

ListBox

A list of items

CheckBox

Useful for on/off or yes/no options

OptionButton

Used in groups, allows the user to select one of several

options

ToggleButton

A button that is either on or off

Frame

Contains other controls

CommandButton

A clickable button

TabStrip

Displays tabs

MultiPage

Tabbed container for other objects

ScrollBar

Draggable bar

SpinButton

Clickable button often used for changing a value

Image

Contains an image

RefEdit

Allows the user to select a range

0 0

Post a comment