Recent

Author Topic: To get the selected item of TRadioGroup  (Read 3407 times)

asdf

  • Sr. Member
  • ****
  • Posts: 310
To get the selected item of TRadioGroup
« on: December 02, 2010, 05:37:13 pm »
sp1, sp2, sp3 : string;

RadioGroup1.Items.Add(sp1);
RadioGroup1.Items.Add(sp2);
RadioGroup1.Items.Add(sp3);

How can we get the caption of the selected item?
Lazarus 1.2.4 / Win 32 / THAILAND

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1917
Re: To get the selected item of TRadioGroup
« Reply #1 on: December 02, 2010, 05:49:36 pm »
Code: Pascal  [Select][+][-]
  1. var idx:integer;
  2. begin
  3.  idx:=RadioGroup1.ItemIndex;
  4.  if idx>-1 then Caption:=RadioGroup1.Items[idx];
  5. end;
  6.  

 

TinyPortal © 2005-2018