VapiSoft
asked on
CListCtrl
Hi,
I am trying to change the font size in the Header of the a CListCtrl control.
I did as in the attached code but it did not work.
The font just became like a SYSTEM font.
I am trying to change the font size in the Header of the a CListCtrl control.
I did as in the attached code but it did not work.
The font just became like a SYSTEM font.
CHeaderCtrl *header=list.GetHeaderCtrl( );
HWND hwnd=header->GetSafeHwnd();
HDC hDC=::GetDC(hwnd);
CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT)); zero out structure
lf.lfHeight = 6; request a 12-pixel-height font
strcpy(lf.lfFaceName, "Arial Narrow"); request a face name "Arial"
VERIFY(font.CreateFontIndirect(&lf)); create the font
header->SetFont( &font);
::SelectObject( hDC, (HFONT) font);
::ReleaseDC(hwnd,hDC);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://www.experts-exchange.com/questions/21843896/Font-Size-CHeaderCtrl.html