📄 font_selection_combo.shtml.htm
字号:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Zafir Anjum">
<TITLE>Miscellaneous - Owner Drawn Font Selection ComboBox</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000" bgproperties="fixed">
<table WIDTH="100%">
<tr WIDTH="100%">
<td><td>
</tr>
</table>
<CENTER>
<H3>
<FONT COLOR="#AOAO99">Owner Drawn Font Selection ComboBox</FONT></H3></CENTER>
<CENTER>
<H3>
<HR></H3></CENTER>
This code was contributed by <A HREF="mailto:Girish_Bharadwaj@smtpnotes.pictel.com">Girish Bharadwaj</A>.
<p>Following is a owner drawn Combo Box which will be filled with the names of
the fonts.. And each entry is in same font as selected. This is something
similar to the one in Netscape 4.x font selector.
<p>This is pretty simple. All it does is to enumerate the fonts and store the
LOGFONTs in the Item data. and when the painting is to be done, takes the
value from the Item data and paints the item..
<p>It has a very nice effect.. Since this does only the font names, you might
need another combobox for the sizes..
<p>You can also set the colors for the highlight and normal..
<p>To use this, Create a ComboBox in your Resource Editor, Set the Owner draw
to "Variable" and check the "Has strings".
<p>Then, In the OnInitDialog () or OnInitialUpdate() call the function
FillFonts (). Thats it.. You have got your fonts in the Combo box. To get
the selected font, Use GetSelFont () with LOGFONT& as the argument. this
argument will be filled in upon return.
<p>P.S:If you make the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -