I used the following code to implement a font menu in my program:
CFont m_font;
void CTestFormView::OnViewFont()
{
CFontDialog dlgChooseFont;
if(dlgChooseFont.DoModal() == IDOK)
{
m_font.DeleteObject();
m_font.CreateFontIndirect(
dlgChooseFont.m_cf.lpLogFont);
}
}
the problem is that text spills out of the drawing area when the user selects a font size beyond 14. how can I implement a font menu that limit the font size available?
CFont m_font;
void CTestFormView::OnViewFont()
{
CFontDialog dlgChooseFont;
if(dlgChooseFont.DoModal() == IDOK)
{
m_font.DeleteObject();
m_font.CreateFontIndirect(
dlgChooseFont.m_cf.lpLogFont);
}
}
the problem is that text spills out of the drawing area when the user selects a font size beyond 14. how can I implement a font menu that limit the font size available?