Microsoft Office Tutorials and References
In Depth Information
Adjusting UserForm Controls
A ToggleButton control has two states: on and off. Clicking the button toggles between these
two states, and the button changes its appearance. Its value is either True (pressed) or False
(not pressed). I never use this control because I think a CheckBox is much clearer.
Adjusting UserForm Controls
After you place a control in a UserForm, you can move and resize the control by using standard
mouse techniques.
You can select multiple controls by Shift-clicking or by clicking and dragging to lasso a
group of controls.
A UserForm can contain vertical and horizontal gridlines (displayed as dots) that help you align
the controls that you add. When you add or move a control, it snaps to the grid to help you line
up the controls. If you don’t like to see these gridlines, you can turn them off by choosing
Tools➜Options in the VBE. In the Options dialog box, select the General tab and set your desired
options in the Form Grid Settings section.
The Format menu in the VBE window provides several commands to help you precisely align and
space the controls in a dialog box. Before you use these commands, select the controls that you
want to work with. These commands work just as you’d expect, so I don’t explain them here.
Figure 13-4 shows a dialog box with several OptionButton controls about to be aligned. Figure
13-5 shows the controls after being aligned and assigned equal vertical spacing.
When you select multiple controls, the last control that you select appears with white
handles rather than the normal black handles. The control with the white handles is
used as the basis for sizing or positioning.
Adjusting a Control’s Properties
Every control has a number of properties that determine how the control looks and behaves. You
can change a control’s properties, as follows:
h At design time when you’re developing the UserForm. You use the Properties window to
make design time changes.
h During runtime when the UserForm is being displayed for the user. You use VBA
instructions to change a control’s properties at runtime.
Search JabSto ::

Custom Search