Hello All,
I've been trying to modify an app to be able to resize nicely and I've finally gotten that working. However, while the controls in my main dialog get bigger, the font stays the same size, which is a problem.
I wanted the font to get proportionally bigger as the dialog grew, but have run into a number of problems.
I have a vector that contains ID's of the controls I want to modify.
Here are a few things I've tried:
void CAppDlg::augmentFont(double change)
{
LOGFONT lf; // Used to create the CFont.
CFont m_font;
memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
lf.lfHeight = 20 * change;
strcpy(lf.lfFaceName, "Arial");
m_font.CreateFontIndirect(&lf); // Create the font.
for(int i = 0; i < controlVector.size(); i++)
{
GetDlgItem(controlVector[i])->SetFont(&m_font);
}
}
...and I've also tried:
void CAppDlg::augmentFont(double change)
{
CFont m_font;
m_font.CreateFont (((int)20*change), 0, 0, 0, FW_THIN, false, false, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
for(int i = 0; i < controlVector.size(); i++)
{
[INDENT]GetDlgItem(controlVector[i])->SetFont(&m_font);][/INDENT]
}
I've even tried playing around with the DC, but that didn't do anything.
I could really use some direction.
Thanks!