Control CStatic, Height of FONT
-
MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");
-
MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");
durban2 wrote:
font.CreateFont(640, // 320 - same
Why 640?
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");
Use following method for a try.
CFont font;
VERIFY(font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial"))); // lpszFacenameGetDlgItem(IDC_STATIC_TITLE)->SetFont(&font);
studing is processing in this life.
-
Use following method for a try.
CFont font;
VERIFY(font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial"))); // lpszFacenameGetDlgItem(IDC_STATIC_TITLE)->SetFont(&font);
studing is processing in this life.