Adjusting User Form Controls

After a control is placed in a UserForm, you can move and resize the control by using standard mouse techniques.

Tip 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-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.

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

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


Llsscf onnl r Chw^oKl r r ¡:h«*Biixi r 0*dS(Hi r ChKifaxS

hHT fTl n" I


Figure 13-5: Six controls, aligned and evenly spaced.

Tip 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.


0 0

Post a comment