Solved

Checked Tradiogroup at Run time

Posted on 2001-06-15
4
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 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