Setting Other Control Properties

The controls that you placed on the Info Survey form are objects. Each of these objects has its own properties and methods. In the previous section, you changed the Name property for all the objects that will be referenced later from within VBA procedures. The control properties can be set during the design phase of your custom form or at run time (that is, when your VBA procedure is executed).

Let's now set some control properties for selected controls. To set a property, click a control on the form, locate the desired property in the

Properties window, and type the new value in the space to the right of the property name. For example, to set the ControlTipText property of the lboxSystems control, click the list box control on the Info Survey form and locate the ControlTipText property in the Properties window. In the right-hand column of the Properties window, type the text you want to display when the user positions the mouse pointer over the list box control: Select only one item.

1. Change the object properties as shown below.

Object Name Property Change to

IboxSystems ControlTipText Select only one item spPercent Max 100

spPercent Min 0

OK button Accelerator O

Cancel button Accelerator C

piclmage PictureSizeMode 0 - fmPictureSizeModeClip

The Accelerator property indicates which letter in the object name can be used to activate the control in the keyboard shortcut combination. The specified letter will appear underlined in the caption (title) of the object. For example, after displaying the form, you will be able to quickly select OK by pressing Alt+O.

The other properties of the Info Survey form objects will be set directly from VBA procedures.

0 0

Post a comment