Group
The Group Control Object property is designed for use with the radio button Control Object. It allows the script to group a series of radio buttons (option buttons), so that only one of the radio buttons can be selected at one time.
Syntax |
ControlObject.Group = Value. Where ControlObject is the name of the Control Object that is to be part of a group or excluded from a group. |
Description |
Sets the Control Object to be included/excluded from a group. When a radio button Control Object has its Group property set to True, it becomes part of a Group. The Group contains subsequent radio buttons in the script until another radio button with its Group property set to True is found. A radio button that has its Group property set to True indicates the start of a new Group. |
Arguments |
Value {Boolean} If set to True (1), the radio button Control Object is part of a new Group; if set to False (0), the radio button Control Object is either part of an existing Group or is not to be included in a Group at all. Radio buttons have their Group property set to False by default, so you only need to set the Group property to True if you want to start a new Group in the script. |
Returns |
Boolean. |
Example:
A button on a Mimic is associated with a script that, when executed, causes a Form to be displayed. The Form contains two groups of radio buttons for setting the alignment of a shape. The user can select one radio button from each group.
To create the two groups of radio buttons, the following script is included in the script:
- Set frmLeft = Form.AddRadioButton(2,2,"Left")
- frmLeft.Group = True
- Set frmCenter = Form.AddRadioButton(2,4,"Center")
- Set frmRight = Form.AddRadioButton(2,6,"Right")
- Set frmTop = Form.AddRadioButton(15,2,"Top")
- frmTop.Group = True
- Set frmMiddle = Form.AddRadioButton(15,4,"Middle")
- Set frmBottom = Form.AddRadioButton(15,6,"Bottom")
The first line, Set frmLeft = Form.AddRadioButton(2,2,"Left"), sets the frmLeft variable to add a radio button at coordinates 2, 2, with the text label "Left". The second line, frmLeft.Group = True, sets the 'Left' radio button to be in a group (its Group property is set to True). Subsequent radio buttons will be included in the same group as the 'Left' button until the script comes to another Group = True. So, the 'Center' and 'Right' radio buttons are included in the same group as the 'Left' button, and the user will only be able to select one option from 'Left', 'Center', and 'Right'.
As the 6th line sets the Group property of the frmTop variable to True, a new group is started. Any radio buttons that are created after the 'Top' radio button will be included in the same group as the 'Top' radio button and not in the same group as the 'Left', 'Center' and 'Right' radio buttons. As with the first group, the user can only select one option from the group, and so can only select one from 'Top', 'Middle' or 'Bottom'.
To set the radio buttons to affect an item on the Mimic, an If statement would be used.