LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // clear out structure. lf.lfHeight = 120; // request a 12-pixel-height font strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial".CClientDC dc(this);CFont font; VERIFY(font.CreatePointFontIndirect(&lf, &dc)); // Do something with the font just created... CFont* def_font = dc.SelectObject(&font); dc.TextOut(5, 5, "Hello", 5); dc.SelectObject(def_font);// Done with the font. Delete the font object. font.DeleteObject();
LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // clear out structure. lf.lfHeight = 120; // request a 12-pixel-height font strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial".CClientDC dc(this);CFont font; VERIFY(font.CreatePointFontIndirect(&lf, &dc)); // Do something with the font just created... CFont* def_font = dc.SelectObject(&font); dc.TextOut(5, 5, "Hello", 5); dc.SelectObject(def_font);// Done with the font. Delete the font object. font.DeleteObject();
memset(&lf, 0, sizeof(LOGFONT)); // clear out structure.
lf.lfHeight = 120; // request a 12-pixel-height font
strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial".CClientDC dc(this);CFont font;
VERIFY(font.CreatePointFontIndirect(&lf, &dc)); // Do something with the font just created...
CFont* def_font = dc.SelectObject(&font);
dc.TextOut(5, 5, "Hello", 5);
dc.SelectObject(def_font);// Done with the font. Delete the font object.
font.DeleteObject();
memset(&lf, 0, sizeof(LOGFONT)); // clear out structure.
lf.lfHeight = 120; // request a 12-pixel-height font
strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial".CClientDC dc(this);CFont font;
VERIFY(font.CreatePointFontIndirect(&lf, &dc)); // Do something with the font just created...
CFont* def_font = dc.SelectObject(&font);
dc.TextOut(5, 5, "Hello", 5);
dc.SelectObject(def_font);// Done with the font. Delete the font object.
font.DeleteObject();
当然了,如果自绘一下ComboBox就更完美了.