Results 1 to 9 of 9

Thread: BOLD Font - Simple Question Really.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    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

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    Borland C++ Builder 4
    Thanks

    Simon

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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));
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    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

  7. #7
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  9. #9
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I'm guessing too but anyway try this:
    Code:
    ScoreLabel40->Font->Style = ScoreLabel40->Font->Style<< fsBold;
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width