RadioButton Class
|
|
Create a radio button.
Inheritance Hierarchy
Namespace:
VO
Assembly:
VOGUIClasses (in VOGUIClasses.dll) Version: 2.24 GA
SyntaxThe RadioButton type exposes the following members.
Constructors
Properties|
| Name | Description |
|---|
 | Pressed |
A logical value representing the current state of the radio button (TRUE if it is on, FALSE if it is off).
|
 | TextValue |
RadioButton:TextValue is set to the RadioButton:Caption text.
(Overrides TextValue.) |
 | Value |
RadioButton:Value contains TRUE if the radio button is in the pressed (ON) state or FALSE if it is not pressed (OFF).
(Overrides Value.) |
Top
Methods|
| Name | Description |
|---|
 | Destroy |
Provide a method to de-instantiate a RadioButton object.
(Overrides Destroy.) |
Top
Remarks
Radio buttons are typically presented in related groups and provide mutually exclusive responses to a condition where only one choice is appropriate. (For example, a group of radio buttons might allow you to choose Inches, Centimeters, or Picas.)
Only one radio button can be on in each radio button group. When a different button is pressed, the previously selected button is turned off. In the Window Editor, the Group style setting is checked for each radio button group, to designate the first control in each group. If you do not explicitly create two or more groups, then there will be only one group for the entire window and only one radio button may be selected at a time.
A radio button is said to be "pressed" when it is filled in, and the RadioButton:Pressed access is TRUE. Like check boxes, radio buttons maintain their state between events. When you create a radio button group using the Window Editor, code is generated so that it functions automatically. The caption is used to indicate which button in the group is pressed, and the selected button's group value is stored in the RadioButton:Value.
Radio buttons may not be bound to a field in a server, like other controls. Instead, a radio button group may be bound to a field.
In Windows, radio buttons are equivalent to a button with the BS_RADIOBUTTON style. The style BS_AUTORADIOBUTTON is also very useful because the button is automatically turned on and off without any code being written in the system's Window:ButtonClick() event handler.
In Windows, radio buttons can be created in a resource entity as follows:
1RESOURCE IDD_ABOUT DIALOG 20, 20, 160, 120
2STYLE WS_POPUP | WS_DLGFRAME
3BEGIN
4RADIOBUTTON "&Black" IDB_BLACK, 10, 20, 40, 12
5RADIOBUTTON "&Gray" IDB_GRAY, 10, 35, 40, 12
6RADIOBUTTON "&White" IDB_WHITE, 10, 50, 40, 12
7CONTROL "&Auto",IDB_AUTO, "button"; BS_AUTORADIOBUTTON, 10,65,40,12
8END
See Also