Changes of label Font properties(BCB 4.0)

This one is really going to show that I have less than 2 years of C++ programming experiance....

Borland C++ Builder 4.0 pro  

Here is a code snippet from a switch statement that is supposed to change the font color and style (bold) depending on the value of an editbox variable.

case 1:
      {
         ...// some stuff
         if(water == 2)
         {
            water = 200;
            labelDiagWater->Font->Style = fsBold;
            labelDiagWater->Font->Color = clYellow;
         }
         ...// other stuff

This brings up:
[C++ Error]Main.cpp[167]: E2034 Cannot convert 'TFontStyle' to 'TFontStyles'.

If I comment out the fsBold line, the program runs fine and changes the font color to yellow when needed.  I cannot get the font to change to Bold.  I have tried all sorts of things, and the Borland help files, as great as they are, do not seem to be giving me the answer that I need.

Thanks...
LordDameinAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mirtolConnect With a Mentor Commented:
Oh and to just set the style to bold (no underline, italic etc) use:

labelDiagWater->Font->Style = TFontStyles() << fsBold;
0
 
mirtolCommented:
Yep, that's because Font->Style is a Set

To make bold use:
labelDiagWater->Font->Style << fsBold;

To make unbold use:
labelDiagWater->Font->Style >> fsBold;



0
 
LordDameinAuthor Commented:
Well, I learned something new today!!!

Thanks...
0
All Courses

From novice to tech pro — start learning today.