Solved

Checked Tradiogroup at Run time

Posted on 2001-06-15
4
195 Views
Last Modified: 2010-04-06
I have a radiogroup box which is empty at design time but becomes populated at run time. When I pupulate it the item index is always -1 which means that no buttons are checked.

I can't find a way to set the dirst radio button as checked in code. I can set the item index, but this does nothing for the checked status of the button.

Any ideas
0
Comment
Question by:mike_tipping
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
ITugay earned 100 total points
ID: 6194352
Hi mike_tipping,

to set radio button checked:
   RadioGroup1.ItemIndex := nn;
to clear checked button you should check another button

to clear all buttons set
  RadioGroup1.ItemIndex = -1;

-----
Igor.
0
 
LVL 4

Expert Comment

by:jsweby
ID: 6194592
Hi,

You might find that you are better off using a GroupBox and indiviual TRadioButtons in the GroupBox. RadioButtons in a GroupBox are mutually exclusive just as they are in a TRadioGroup, but you have the advantage of setting the Checked value of a specific radio button and having the OnClick event for the RadioButtons.

J.
0
 

Author Comment

by:mike_tipping
ID: 6194624
Well that was an easy 100 points... I was being stupid and setting the valuse at the wrong point.

Cheers

Mike T
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6194727
Hi mike_tipping,

really easy :-)

thanx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question