-
May 2nd, 2020, 09:17 AM
#1
Bolding a Font of Groupbox heading/label in CDialog
How to bold a font of groupbox heading/label in CDialog.I tried below code but it didn't worked.
Code:
CWnd * pwnd = GetDlgItem(IDC_GROUPBOX);
CFont * pfont = pwnd->GetFont();
LOGFONT lf; pfont->GetLogFont(&lf);
lf.lfItalic = TRUE; //To Make Text Italic
lf.lfWeight = 500; //To Make BOLD, Use FW_SEMIBOLD,FW_BOLD,FW_EXTRABOLD,FW_BLACK
lf.lfUnderline = TRUE; //Underline Text
pfont->CreateFontIndirect(&lf);
pwnd->SetFont(pfont);
-
May 2nd, 2020, 10:00 AM
#2
Re: Bolding a Font of Groupbox heading/label in CDialog
Victor Nijegorodov
-
May 2nd, 2020, 10:53 AM
#3
Re: Bolding a Font of Groupbox heading/label in CDialog
I tried exactly same but nothing is reflecting
-
May 2nd, 2020, 11:53 AM
#4
Re: Bolding a Font of Groupbox heading/label in CDialog
Did you create a CFont member variable?
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);
Victor Nijegorodov
-
May 2nd, 2020, 10:16 PM
#5
Re: Bolding a Font of Groupbox heading/label in CDialog
I tried the exact code that i have written in my first thread
-
May 3rd, 2020, 02:43 AM
#6
Re: Bolding a Font of Groupbox heading/label in CDialog
 Originally Posted by Beginner_MFC
I tried the exact code that i have written in my first thread
du you see the difference between your code from your OP and
 Originally Posted by VictorN
Did you create a CFont member variable?
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);
Victor Nijegorodov
Tags for this Thread
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
|