Changing Text font size without changing window size
-
I wanted to make some really large letters in my application but whenever I change the font size everything within the window becomes bigger, buttons, etc... Is there anyway to only change the letter font sizes only? Thanks
If you change the font through Dialog Properties the dialog size will also be resized, Instead change the font of a window from within the code //put this in constructor
LOGFONT lf;
memset(&lf,0,sizeof(lf));
lf.lfHeight = -14;
lf.lfWeight = FW_BOLD;
lf.lfUnderline = (BYTE)TRUE;
_tcscpy(lf.lfFaceName,_T("Arial"));m_fontBig.CreateFontIndirect(&lf);
Not set the font anywhere you like
//m_targetWindow should be created by now otherwise this will ASSERT
m_targetWindow.SetFont(&m_fontBig);
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
-
I wanted to make some really large letters in my application but whenever I change the font size everything within the window becomes bigger, buttons, etc... Is there anyway to only change the letter font sizes only? Thanks
Hi for change font and font size you can use CreateFont and SelectFont