RadioGroupBox Control

This component provides a group of radio buttons from which the user will be able to select just one. To put buttons and words into the group select the Items property and click on the ellipsis:

This opens the string list editor, each line of which produces a button in the group. The first button has an index of 0, the second an index of 1, and so on. A simple example:

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
 if RadioGroup1.ItemIndex=0 then
  edit1.text:='button1'
 else
  if RadioGroup1.ItemIndex=1 then
   edit1.text:='button2'
  else
   if RadioGroup1.ItemIndex=2 then
    edit1.text:='button3'
end;

To store values in a file you could set an integer variable to the index value and check this when you read the file. Alternatively you could store a Boolean value (true or false), as in the example above.

Back to Tutorial

Back to Palette List