I want to set font size and font color for button in MFC. But MFC differrent from win32. It have no font style in property. please help me , How set font color and font size for button in MFC ?
Printable View
I want to set font size and font color for button in MFC. But MFC differrent from win32. It have no font style in property. please help me , How set font color and font size for button in MFC ?
From this anybody could conclude that win32 does have ones, right? This is new to me, as VS uses the same resource editor for C++ projects, including MFC and Win32. :) You might be talking about WinForms, but this is absolutely different story.
You can change font family, size and weight quite easily by creating new font and setting it explicitly to the button. However, text color is changeable for owner-draw buttons only, but this button style makes you be responsible for drawing entire button face, borders, etc.Quote:
please help me , How set font color and font size for button in MFC ?
Explicitly define the Font style :
Finally delete the CFont.Code:CFont SFont;
SFont.CreateFont(15,7,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,0,0,0,0,"Times New Roman");
ButtonContolName.SetFont(&SFont);
Refer the below link also :
Change color and font-color of a MFC-Button
Color Button
Thank you Mr. Victor, Still now I used the below code in the next line SetFont() method.
SFont.DeleteObject();