|
- Overview
- Initializing the choice of a Radio Button control
- Displaying a Radio Button control with no default option
- Retrieving the option selected in a Radio Button control
- Case of a Radio Button control that returns an integer
- For a Radio Button control that returns a value
- Pre-filled SWITCH on the Radio Button controls
- Modifying the caption of a Radio Button control
- Case of Radio Button controls with sub-captions
- Modifying the colors of captions for the options found in a Radio Button control
- Properties specific to the Radio Button controls
Handling a Radio Button control by programming (prefixed syntax)
WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Radio Button control by programming. To do so, use the variable of Radio Button control in the code. Regardless of the type of radio button, each option can be associated with: - an integer. This integer can take a value from 1 to N, N being the total number of options found in the radio button. The first option is the option #1, the second option is the option #2, ... The options are numbered from top to bottom and from left to right.
  a specific returned value . This returned value is specified in the "Content" tab of the control description window.
Initializing the choice of a Radio Button control By default, the first option is selected when a Radio Button control is displayed. To check an option of a Radio Button control: - if the Radio Button control returns an integer, use the following syntax:
<Name of Radio Button control> = <Option subscript>
- if the Radio Button control returns a specific value (in WINDEV or WINDEV Mobile only), use the following syntax:
<Name of Radio Button control> = <Option value>
The selection of an option unchecks the option that is currently selected. Remark: If the control is associated with a data file item, the assignment is automatically performed via: See Linking a Radio Button control to an item for more details. Retrieving the option selected in a Radio Button control Case of a Radio Button control that returns an integer To retrieve the subscript of the option selected in the Radio Button control, use the following syntax:
<Option subscript> = <Name of Radio Button control>
In this case, the <Option subscript> parameter is an integer corresponding to the number of the selected option. To find out the caption of the option selected in the Radio Button control, use the following syntax:
<Option caption> = <Name of Radio Button control>[Name of Radio Button control]..Caption
Remark: If the control is associated with a data file item, the entered value is automatically retrieved by using: See Linking a Radio Button control to an item for more details. Versions 18 and laterPre-filled SWITCH on the Radio Button controls When typing the SWITCH statement relative to a Radio Button control, the code editor automatically adds the CASE corresponding to the different options of the Radio Button control. The caption of each option is automatically added in line comment. Some examples: - Code for a Radio Button control that returns an integer: typing "SWITCH RADIO_Title" in the code editor displays:
- Code for a Radio Button control that returns a value: typing "SWITCH RADIO_TodaysMenu" in the code editor displays:
New in version 18Pre-filled SWITCH on the Radio Button controls When typing the SWITCH statement relative to a Radio Button control, the code editor automatically adds the CASE corresponding to the different options of the Radio Button control. The caption of each option is automatically added in line comment. Some examples: - Code for a Radio Button control that returns an integer: typing "SWITCH RADIO_Title" in the code editor displays:
- Code for a Radio Button control that returns a value: typing "SWITCH RADIO_TodaysMenu" in the code editor displays:
Pre-filled SWITCH on the Radio Button controls When typing the SWITCH statement relative to a Radio Button control, the code editor automatically adds the CASE corresponding to the different options of the Radio Button control. The caption of each option is automatically added in line comment. Some examples: - Code for a Radio Button control that returns an integer: typing "SWITCH RADIO_Title" in the code editor displays:
- Code for a Radio Button control that returns a value: typing "SWITCH RADIO_TodaysMenu" in the code editor displays:
Modifying the caption of a Radio Button control The ..Caption property is used to: - change the caption of Radio Button control:
<Name of Radio Button control>..Caption = <Caption>
- change the caption of all options found in the Radio Button control:
The options must be separated by the TAB character. You have the ability to specify the first options only.
<Name of Radio Button control>..Caption = <Option 1>+TAB+<Option 2>+TAB+<Option 3> ...
- retrieve and modify the caption of an option:
// Get the sub-caption <Sub-caption> = <Name of Radio Button control>[<Option subscript>]..SubCaption
// Modify the sub-caption <Name of Radio Button control>[<Option subscript>]..SubCaption = <New sub-caption>
Modifying the colors of captions for the options found in a Radio Button control Properties specific to the Radio Button controls The following properties are used to manage the characteristics of a Radio Button control by programming. | | HorizontalAlignment | Used to find out and modify the horizontal alignment of a control. | VerticalAlignment | Used to find out and modify the vertical alignment of a control. | Color | Used to find out and modify the color of the text for the options found in the Radio Button control. | BackgroundColor | Used to find out and modify the background color of the Radio Button control. | NumberColumn | Used to find out the number of columns in a Radio Button control. | Count | Used to find out the number of options in a Radio Button control. | SubCaption | Used to find out and modify the sub-caption of an option found in a Radio Button control. | InitialValue | Used to find out the initial value of a Radio Button control. | ReturnedValue | Used to find out and modify the value returned by an option found in a Radio Button control. |
To find out the entire list of WLanguage properties that can be used with a Radio Button control, see Properties associated with a Radio Button control.
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |