Assigning properties to dialog box controls
You can identify the Name property of a control. The Name property of a dialog box control is usually the way you reference that object in a macro, link command, or spreadsheet function. This property is accessed for graphic objects, clipart, maps, charts, and OLE objects.
The Selected property indicates numerically which radio button in a group box is chosen, or which item in a list box or combo box is selected. Numbers are sequential (beginning at zero). If the first item is chosen or selected, the Selected property is set to 0. Choosing or selecting the second item sets the Selected property to 1, and so on.
Along with setting the Selected property, you can set the Selection text property. With this property, you can specify the selected text to display in a list box. You see this text selected when the control is activated or when you open the dialog box.
Every dialog box has a default button that closes the dialog box. By default, the OK button in a dialog box performs this function. You can assign another control the same function.
You can assign shortcut keys to both labeled and unlabelled controls. Assigning a shortcut key to a control allows you to run a macro when the control is selected or activated. For more information about using these events, see “Understanding link events.”
You can specify areas of a dialog box or control where access is not available.
For more information about specific controls, see “Adding dialog box controls” and “Outline of control-specific properties.” For more information about specific properties, see “Properties of form controls.”
To identify the Name property of a dialog box control |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control, and click Properties Name.
|
You can also
|
|
Identify the object ID property of a dialog box control
|
Right-click the control, and click Properties Object ID.
|
•
|
|
For information about changing the name of a dialog box control, see “To rename a control in a dialog box.”
|
To set the Selected property for a dialog box control |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control, and click Properties Selected.
|
4.
|
|
Type a number in the Enter number box.
|
This will indicate which item is selected.
|
To set the Selection Text property for a dialog box control |
1.
|
|
Click the
Quick tab button at the bottom of the application window to display the Objects sheet. |
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control, and click Properties Selection text.
|
4.
|
|
Type text in the Enter text box.
|
•
|
|
For more information about creating the list used in a list box, see “To add a list box to a dialog box”, “To add a spin control to a dialog box”, or “To add a file control to a dialog box.”
|
To make a dialog box control the default button |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control, and click Properties Default button Yes.
|
To assign a shortcut key to a labeled dialog box control |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Double-click a label.
|
4.
|
|
Click just before the letter to use.
|
5.
|
|
Type &.
|
6.
|
|
Press Enter.
|
•
|
|
When a control or label control has an attached shortcut, a letter of the label is underlined.
|
To assign a shortcut key to an unlabeled dialog box control |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control without a label, and click Properties Name.
|
4.
|
|
Click just before the letter to use.
|
5.
|
|
Type &.
|
6.
|
|
Press Enter.
|
•
|
|
If you use more than one ampersand, the first is recognized as a shortcut key designation, and the remaining ones display as text.
|
To limit access to a dialog box control or dialog box |
1.
|
|
Click the Quick tab button at the bottom of the application window to display the Objects sheet.
|
2.
|
|
Double-click a dialog box.
|
3.
|
|
Right-click a control, and click Properties Depend on.
|
4.
|
|
Disable any check boxes corresponding to areas in which you do not want the control available.
|
•
|
|
If all options in the Depend on property are checked, the control is always available.
|
•
|
|
You can also limit access to dialog boxes and controls by using password protection. For information about assigning password protection, see “Using password protection.”
|