Radio Buttons & Group Box

 

 

After going through this page you should be able to use the RadioButtons and Group Box that are provided by VIEWS.

 

 

1.  Radio Buttons

Radio Buttons enable a user to choose only one option amongst various options, i.e. Radio Buttons may only be placed inside a GroupBox, and only one Radio button within the GroupBox can be selected at a time.  Clicking one radio button causes it to be checked and the previously selected button to be left unchecked.  The Radio Button provides the following properties.

Name = S, Text = S, TextAlign = CA, Checked = B, Height = M, Width = M, ForeColor = C, BackColor = C, Font = FNT. 

  The full description of these properties can be found here.

 

2.  Group Box

GroupBox is used for grouping RadioButtons.  Each item between open and close tags must be RadioButton controls.  GroupBox has the following properties.

Name = S, Text = S, Image = F, Height = M, Width = M, ForeColor = C, BackColor = C, Font = FNT, halign = HA, valign = VA

 

Examples of RadioButtons and GroupBox

 

The next Example simply shows how a GroupBox can be used with RadioButtons. Like Buttons if the Text attribute is omitted, Name attribute is used as text as well.

 

Example 3.1.1: Source

 

                                                                          

The code below is responsible for Example 3.1.1.

@"<Form Text= 'Radio Buttons'>
<Horizontal>
  <GroupBox BackColor = LightBlue>
   <RadioButton Name = option1 Checked = true Font = Bold10 BackColor = Yellow/>
     <RadioButton Name = option2 Font = Bold10 ForeColor = Red/>
    <RadioButton Name = option3 Font = Bold10 ForeColor = Green/>
   <RadioButton Name = option4 Font = Bold10 ForeColor = Blue/>
  </GroupBox>

</Horizontal>
</Form>";

 

<<PREVIOUS  |  NEXT>>