0

I have to add one TEdit wit two radio buttons in a group of radiobuttons. I was searching information but nothing helps me.

How I can add?

1
  • One way would be to put a TGroupBox on your form, and then you can put the TEdits and a number of individual TRadioButtons (rather than a TRadioGroup) in it.
    – MartynA
    Nov 16, 2015 at 9:45

1 Answer 1

1

Do the following:

  1. Add a group box, TGroupBox, which will act as the container.
  2. Add two radio buttons, TRadioButton, as children of the group box.
  3. Add an edit, TEdit, as a child of the group box.

The radio group control, TRadioGroup is essentially a convenience control. You could implement a radio group from a group box and a bunch of radio buttons, but since that is such a common task, the radio group control is provided to wrap up all those details for you.

In your scenario, you want something a little more flexible than is provided by a radio group, and so you have to populate the group box manually.

7
  • Okey, now I have to do that pressing the second radiobutton the Tedit be enabled.
    – M.Gómez
    Nov 16, 2015 at 16:20
  • You're welcome! Use the OnClick event handlers of the radio buttons, and in those handlers set the Enabled property of the edit control. Nov 16, 2015 at 16:56
  • But i have to use a Radiogroup. Because i have to collect the position of ItemIndex. I have to do a RadiogroupButton and one tedit.
    – M.Gómez
    Nov 17, 2015 at 9:09
  • I need 4 radiobuttons and the last one i need that when this radiobutton is checked, the tedit has to be enabled=true
    – M.Gómez
    Nov 17, 2015 at 9:10
  • I use what you say and it works, but i have a problem. I dont know how to put the event Onclick. I dont know what i have to put.
    – M.Gómez
    Nov 17, 2015 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.