Adjusting User Form Controls

After a control is placed in a dialog box, you can move and resize it with 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 grid lines (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 grid lines, 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 would expect, so I don't explain them here. Figure 13-3 shows a dialog box with several OptionButton controls about to be aligned.

Figure 13-3: Use the Format ^ Align command to change the alignment of controls.

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 model against which the other blackhandled controls are compared for size or position.

0 0

Post a comment