0
votes

I want to change the forecolor of radio buttons texts when the Group box Enabled property is set to false. The disabled color is so absurdly dark that you can't read the text in this state. I tried many things (like overriding the system default disabled color mode) without success.

I have no choice but to use this kind of controls, so I'm looking for a workaround. My idea was to superpose a lightly greyed label on the text, but this cause errors when initializing the control box.

I tried the following code to get the label out of the parent control box and avoid this problem:

RadioButtonLabel.Parent= Main_menu.Activeform;

I have no more errors, but the label now basically disappear in runtime.

Any solution?

1
What are you targetting: Winforms, WPF, ASP..? Always tag your question correctly!TaW
Can you not use the GroupBox.Enabled event. Within that, if enabled then make radiobutton = somecolour, if not enable then someothercolour?GandRalph
I actually use RadioButton.Enabled property. RadioButton.ForeColor property is overrided by the Enabled propertyespressif

1 Answers

0
votes

instead of using dark color, try using this: (this is just an idea code)

if(groupbox.enable == false)
{
radiobutton.text = ""; //it means show nothing
}
else
{
radiobutton.text = "Whatever you like";
}