-1

I have two forms in my project in c++ Builder 2010. I have created RadioGroup in the second and listed all my buttons there, but I have few problems:

  1. When I load my form and check some button, the earlier selection stays checked until I hover mouse over it.

  2. How to make the buttons from second form affect the first form?

  3. How to make certain TEdit box go grey and unselectable when checking certain radiobuttons?

manlio
  • 18,345
  • 14
  • 76
  • 126
user3403621
  • 77
  • 1
  • 13

1 Answers1

1

I found this by googling embarcadero radio, first hit: embarcadero docs

Essentially, radio buttons are not mutually exclusive unless you use a radio group.

Two questions in one is not a great idea, but to answer the second just set TButton->Enabled to false.

Gregor Brandt
  • 7,659
  • 38
  • 59
  • Yeah, sorry, I have so many small questions that I didn't want to ask them seperately. I have kinda solved the passing variables between forms, by setting edit box by setting edit box to value I want and then getting editbox text from other form which is better in this situation than setting global variables. I only want know now that what should I do to make the other buttons be unchecked immediately I check one box. Now I can check all buttons in the group, but when I hover mouse over the button, checking disappears laving only the last selection. – user3403621 Mar 27 '14 at 19:02
  • 1
    Radio buttons that have the same `Parent` are mutually exclusive to each other. You can put two `TRadioButton` controls on any container other than `TRadioGroup` (`TGroupBox`, `TPanel`, `TForm` etc) and see this behavior is true. When a `TRadioButton` is checked, it iterates through its `Parent.Controls` list looking for other `TRadioButton` controls and unchecks them. – Remy Lebeau Mar 27 '14 at 20:16
  • I found solution: I changed the radiogroup doublebuffered property to true. – user3403621 Mar 27 '14 at 20:24