|
-
Jan 10th, 2001, 06:02 AM
#1
Thread Starter
Lively Member
How do you make a lable have bold font at run time
label1->font->style->fsBold
is what I expected but it appears that it doesn't work
-
Jan 10th, 2001, 06:06 AM
#2
Monday Morning Lunatic
What are you using? Borland? Microsoft? MFC? API?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 10th, 2001, 06:07 AM
#3
Thread Starter
Lively Member
Borland C++ Builder 4
Thanks
Simon
-
Jan 10th, 2001, 06:10 AM
#4
Monday Morning Lunatic
I don't have BC++B...so all I can offer is: check your indirection levels. Are they all pointers?
What the error is might help.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 10th, 2001, 07:53 AM
#5
Frenzied Member
Try this
Code:
HFONT f = CreateFont(13,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_DONTCARE,"Arial");
SendMessage(GetDlgItem(hDlg,IDC_STATIC1),WM_SETFONT,(WPARAM)f,MAKELPARAM(TRUE, 0));
-
Jan 10th, 2001, 07:59 AM
#6
Thread Starter
Lively Member
I already have the structure
ScoreLabel40->Font->Color = clBlack;
ScoreLabel40->Font->Size = 10;
and what I want to do it make the font bold, I think it is something like
ScoreLabel40->Font->Style << fsBold;
But that doesn't work.
Thanks for your help
Simon
-
Jan 10th, 2001, 11:47 AM
#7
Frenzied Member
I've never used Borland C++, but the code i gave you uses only API so it will work for tou. Create the font then send a messsge to ScoreLabel40 to set the font.
-
Jan 10th, 2001, 01:00 PM
#8
Monday Morning Lunatic
I'm just guessing, but perhaps:
Code:
ScoreLabel40->Font->Style |= fsBold;
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 10th, 2001, 04:33 PM
#9
Frenzied Member
I'm guessing too but anyway try this:
Code:
ScoreLabel40->Font->Style = ScoreLabel40->Font->Style<< fsBold;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|