Using the Properties window

In the VBE, the Properties window adjusts to display the properties of the selected item (which can be a control or the UserForm itself). In addition, you can select a control from the drop-down list at the top of the Properties window (see Figure 13-6).

Figure 13-6: Selecting a control (CheckBox3) from the drop-down list at the top of the Properties window.

Note The Properties window has two tabs. The Alphabetic tab displays the properties for the selected object in alphabetical order. The Categorized tab displays them grouped into logical categories. Both tabs contain the same properties but in a different order.

To change a property, just click it and specify the new property. Some properties can take on a finite number of values, selectable from a list. If so, the Properties window will display a button with a downward-pointing arrow. Click the button, and you'll be able to select the property's value from the list. For example, the TextAlign property can have any of the following values: l - fmTextAlignLeft, 2 - fmTextAlignCenter, or 3 - fmTextAlignRight.

A few properties (for example, Font and Picture) display a small button with an ellipsis when selected. Click the button to display a dialog box associated with the property.

The Image control Picture property is worth mentioning because you can either select a graphic file that contains the image or paste an image from the Clipboard. When pasting an image, first copy it to the Clipboard; then select the Picture property for the Image control and press Ctrl+V to paste the Clipboard contents.

Note If you select two or more controls at once, the Properties window displays only the properties that are common to the selected controls.

Tip The UserForm itself has many properties that you can adjust. These properties are then used as defaults for controls that you add to the UserForm. For example, if you change the UserForm Font property, all controls added to the UserForm will use that font.

0 0

Post a comment