Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1326
  • Last Modified:

RadioButton/Checkbox Fonts not changing

HI Everyone,

I'm using Borland c++ builder 6. I'm trying to change the colour of my radiobuttons/checkboxes fonts to white. At design time, the fonts turn white, however, when i run the app the radiobuttons and checkboxes all seem to revert back to black font.

Any Ideas.

Thanks
0
chudmarek
Asked:
chudmarek
  • 3
  • 3
2 Solutions
 
graberCommented:
Iteresting could you post your source. Im using 6.0 as well and don't have a problem.

void __fastcall TForm1::RadioButton1Click(TObject *Sender)
{
   RadioButton1->Font->Color = clRed;
   RadioButton2->Font->Color = clBlack;
}
//---------------------------------------------------------------------------
 
void __fastcall TForm1::RadioButton2Click(TObject *Sender)
{
   RadioButton1->Font->Color = clBlack;
   RadioButton2->Font->Color = clRed;
}
//---------------------------------------------------------------------------

Open in new window

0
 
chudmarekAuthor Commented:
HI Graber,

I changed all the properties at design time, and all the colours appear how they should. but when i run the app it all changes back to black font.

I event tried using code RadioButton1->Font->Color = clWhite;
and still nothing.....it has me very stumped.

Do u think it could have anything to do with parent options.....
0
 
chudmarekAuthor Commented:
Furhter Update,

If i use RadioButton1->Brush->Color = clWhite; the color change works.....RadioButton1->Font->Color = clWhite;  does not
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
George TokasCommented:
>>If i use RadioButton1->Brush->Color = clWhite; the color change works.....RadioButton1->Font->Color = clWhite;  does not
All those depends on WHERE that line is....
The explaination USUALLY is that you are changing the color in your call but the IDE changes when initializing the application...
Check out the following:
Drop a TTimer at your main form and give it an interval of 10mS...
When the handler of the timer is fired then the application finished initializing the form(s) and now you can change whatever you want...
Disable the timer and place the font color change code there and see...
This is a problem I have using Direct3D...
The OnPaint handler called BEFORE Direct3D initialized and that cause Access Violation(s)...
By placing the timer all I'm doing inside the handler is to check the timer status and if it is NOT enabled I know that:
Constructor is called and finished.
OnCreate and OnShow also finished...

George Tokas.
0
 
graberCommented:
hey george and sorry chudmarek for the delay.  chudmarek could you post the unit of code for gtokas and i to look at?
0
 
chudmarekAuthor Commented:
I have come to the conclusion that my app is corrupt somewhere, I tried the same code in another app and it worked fine.....this is too easy of a problem to be this annoying!.....anymore thoughts?
0
 
graberCommented:
not really without seeing the rest of the code.  Good fortune though as you press on.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now