Previous Topic

Next Topic

Inhoudsopgave

Book Index

TRadioButton Control

TRadioButton

Description

Provides a Windows radio button control.

Remarks

Use TRadioButton to add a radio button to a form. Radio buttons present a set of mutually exclusive options to the user. This means that only one radio button in a set can be selected at a time. When the user selects a radio button, the previously selected radio button becomes unselected. Radio buttons are frequently grouped in a radio group box (TRadioGroup). Add the group box to the form first, then get the radio buttons and put them into the group box.

By default, all radio buttons that are directly contained in the same windowed control container, such as a TRadioGroup or TPanel, are grouped. For example, two radio buttons on a form can be checked at the same time only if they are contained in separate containers, such as two different group boxes.

TRadioButton Properties

Property Property Alignment: Enumerated (taLeftJustify, taRightJustify) (R/W)

Determines the position of the caption relative to the radio button. Set Alignment to determine whether the caption of the radio button should appear to the left of the radio button (taLeftJustify) or to the right of the radio button (taRightJustify).

Note: Do not confuse the Alignment property with the alignment of the caption in the text area of the radio button. The caption always appears left aligned. Alignment only controls on which side of the button the text area appears.

Property Property Checked: Boolean (R/W)

Determines whether the option represented by the radio button is selected. Read Checked to determine whether the radio button is selected. Set Checked to true to select the radio button and deselect all other radio buttons in the same container. Set Checked to false to deselect the radio button, leaving no radio button in the group selected.