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);
Re: Bolding a Font of Groupbox heading/label in CDialog
Re: Bolding a Font of Groupbox heading/label in CDialog
I tried exactly same but nothing is reflecting
Re: Bolding a Font of Groupbox heading/label in CDialog
Did you create a CFont member variable?
Quote:
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);
Re: Bolding a Font of Groupbox heading/label in CDialog
I tried the exact code that i have written in my first thread
Re: Bolding a Font of Groupbox heading/label in CDialog
Quote:
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
Quote:
Originally Posted by
VictorN
Did you create a CFont member variable?
Quote:
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);