Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Bold Font in Static Label

Posted on 1999-10-07
Medium Priority
Last Modified: 2013-12-03
How do you make the fonts bold in a Static Label control?
I'm using VC++ 6.

Question by:maximebrunet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 23

Accepted Solution

naveenkohli earned 150 total points
ID: 2106748
You will have to imlement your own sttaic control to do that. Look at the article on codeguru, it will explain on how to do some of this stuf with sttaic controls.

Colored Static Controls

Author Comment

ID: 2106862
Okay, and is it the same thing for a radio button?
LVL 23

Expert Comment

ID: 2107011
In fact for radio buttons, you can set the font of your control in your OnInitDialog function of dialog box. Radio button is CButton control. SO can call SetFont function for that control.

FOr more info, check out this article too..

Correct Use of the SetFont() Function in MFC

Author Comment

ID: 2107287
Well. It's a good answer but I think I found a better way. Here it is if you're interested:

You have to give your static items a different ID for each one.

Then you declare your CFont instance and initialize it to whatever you want

CFont Whatever;
GetDlgItem(IDC_YOURSTATICID)->SetFont(&Whatever, true);

That's it...thx.
LVL 23

Expert Comment

ID: 2107380
Definitely its a better way of doing it. But if you want to do some funky stuff with fonts and colors then u definitely need to override WM_CTLCOLR message. Otherwise SetFont works fine for most of the controls (NOT FOR PUSH BUTTONS).

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question