When you add single-choice buttons to the dialog box, use them as a group. In the Properties window, set the group attribute for the first button in the group. The Control ID of the single-choice button appears in the Add member variable wizard, which allows you to add member variables for the single-choice button group.
In the dialog box, there can be more than one group of radio buttons, each group should be added through the following process.
Add a group of radio buttons to the dialog box
- Select the radiobutton control in the Toolbox window, and click the location where you want to place the control in the dialog box.
- Repeat the steps
1 to add any multiple radio buttons. Make sure that
The tab key order is continuous (for more information, see change the tab key order of the control ).
- In the "properties" windowFirstRadio buttonGroupSet propertyTrue.
SetGroupProperty changedTrueThe ws_group style will be added to this button in the dialog box object of the resource script, and you can only select one single button in the button group at a time (when you click a single button, other buttons in the group are cleared ).
Note: |
Only the first radio button in the group canGroupSet propertyTrue. If there are other controls that do not belong to the button groupOut-of-groupTheGroupSet propertyTrue. By pressing CTRL + D to view the tab key order, you can quickly determine the first control outside the group. |
Add member variables to a single-choice button group
- Right-click the first radio button control in the tab key Order (dominant control andGroupControls with the property set to true ).
- Select"Add variable".
- In the Add member variable wizard, select"Control variables"Check box, and then select"Value"Single-choice button.
- In the variable name box, type the name of the new member variable.
- In"Variable type"In the list box, selectInt Or TypeInt.
- You can modify the code to specify which radio button should be displayed as selected. For example, m_radiobox1 = 0; the first radio button in the selected group.
The tab key order is the order in which the tab key moves the input focus from one control to another in the dialog box. The tab key sequence is usually left to right in the dialog box, from top to bottom. Each control hasTabstopDetermines whether the control receives the input focus.
Set the input focus of the control.
- In the "properties" window, selectTabstopAttributeTrueOrFalse.
Even if the control does not set the tabstop attribute to true, it must be part of the tab key order. This may be important in some situations. For example, when you define an access key (mnk) for a control without a title. The static text that contains the access key of the related control is in
The tab key sequence must be placed in front of the related controls.
Note: |
If the dialog box contains overlapping controls, changing the tab key order may change the display mode of the controls. The control behind the tab key order is always displayed on any overlapping control above the tab key order. |
View the current status of all controls in the dialog boxTabKey order
- In"Format"Click"TabKey order".
-Or-
ModifyTabKey order
- In"Format"Click"TabKey order".
The number in the upper-left corner of each control is displayed in the current
Position in the tab key order.
- Click each control in the order you want the tab key to follow to set the tab key order.
- PressEnterExit"TabKey order"Mode.
Tip: |
After entering the "tab key order" mode, you can press The ESC or enter key disables the ability to change the tab key order. |
ChangeTabKey order
- Slave"Format"Select"TabKey order".
- Specifies where to change the sequence. To do this, press Ctrl and click the control that is located before the control that you want to change its order.
For example, if you want to change the order of controls 7 to 9, press Ctrl and select control 6 first.
Note: |
To set a specific control to number 1 (first in the tab order), double-click the control. |
- Release the ctrl key, and then click the control in the order that you want the tab key to start from.
- PressEnterExit"TabKey order"Mode.