It works quite nicely and all of the typical controls, like edit, button, list control, static labels, combo boxes, etc. redraw themselves with the larger font when they receive the
WM_SETFONT
message I send to each of them as part of the scaling routine.
On the other hand, the Command Link button (class "Button", style bit
BS_COMMANDLINK
) does not repaint itself with the larger font I pass to it via the
WM_SETFONT
message.
So how do I enlarge the text in a command link button using the windows API/GDI?
I thank you in advance for any answers you may provide.
What I have tried:
First try:
m_try.ModifyStyle(BS_COMMANDLINK, 0);
m_font.CreateFont(199, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, 0, 0, 0, 0, L"Arial");
::SendMessage(m_try.GetSafeHwnd(), WM_SETFONT, WPARAM(HFONT(m_font)), 0);
::SendMessage(m_try.GetSafeHwnd(), WM_SETTEXT, 0, (LPARAM)L"Command link");
::SendMessage(m_try.GetSafeHwnd(), BCM_SETNOTE, 0, (LPARAM)L"with note");
second try:
LOGFONT logFont;
font->GetLogFont(&logFont);
logFont.lfWeight = FW_BOLD;
logFont.lfHeight = 120;
m_font.CreateFontIndirect(&logFont);
m_try.SetFont(&m_font);
3rd try;
CFont font2;
font2.CreatePointFont(105,L"Arial");
CFont* big_font = &font2;
GetDlgItem(IDC_COMMAND6_MIL1553B_LOOPBACK)->SetFont(&font2);