Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 722209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:57:48+00:00 2026-05-14T05:57:48+00:00

Please do not mark it as a dupe of this question just yet: Bold

  • 0

Please do not mark it as a dupe of this question just yet:

Bold labels in MFC

That question does not help me; for some reason I do not see the rich edit control. Instead I believe I have to do it in code. here is a sample I found:

http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2006-10/msg00245.html

My problem is that I prefer not to re-invent the wheel and test for errors myself or through QA.

Someone must have implemented this before. Please share your code.

What I would like to do is:

  • Keep the same font size, family, etc. as in the already created label, but make it bold and italic as well.
  • Keep the memory footprint reasonably low (do not create any new unnecessary objects), but do not get the app into an inconsistent state either.

I appreciate your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:57:48+00:00Added an answer on May 14, 2026 at 5:57 am

    You will want to do the following before the static text control is shown on the parent window.

    1. Get a handle to the window: CWnd * pwnd = GetDlgItem(IDC_LABEL);
    2. Get the current font for the static text: CFont * pfont = pwnd->GetFont();
    3. Get the characteristics of the font: LOGFONT lf; pfont->GetLogFont(&lf);
    4. Change the lfWeight and lfItalic fields in lf.
    5. Put a CFont object in your parent window, so it will exist for the entire lifetime of the child window.
    6. Initialize the CFont: m_font.CreateFontIndirect(&lf);
    7. Set the font into the static text window: pwnd->SetFont(&m_font);
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Note: Please do not mark this question as duplicate. This question is based on
I'm not 100% sure how to ask this question so please dont mark me
Please not that I fully understand this is a dumb ass idea, but its
Although there are several threads on this topic.. please do not mark this as
Please read this entire question before you try to mark this as too controversial.
P.S: Please do not mark this as duplicate Hi, I have been trying to
Please help me I am not able to understand why this is happening there
Please forgive a question that has been addressed in some form or fashion previously.
I have just now discovered that my hosting server does not support the ZIP
In another question, Mark speaks highly of IDEs, saying some people still just dont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.