111,126
社区成员
发帖
与我相关
我的任务
分享
public struct FONT_INFO
{
public Int32 nHeight; //字体的高度
public Int32 nWidth; //字体的宽度
public Int32 nEscapement//字符的间隔
public Int32 nOrientation;
public Int32 nWeight;
public bool bItalic;
public bool bUnderline;
public bool cStrikeOut;
public Int32 nCharSet;
public Int32 nOutPrecision;
public Int32 nClipPrecision;
public Int32 nQuality;
public Int32 nPitchAndFamily;
public string facename; //字体的名字
};
[DllImport("gdi32.dll", EntryPoint = "CreateFont")]
public static extern IntPtr CreateFont(FONT_INFO fontex);
//然后在Label里面的字体引用
FONT_INFO fontinfo = new FONT_INFO();
fontinfo.nHeight = 20;
fontinfo.nWidth = 20;
fontinfo.facename = "Arial"
Label1.Font = Font.FromHfont(CreateFont(fontinfo));
Label1.Text = "我们的祖国"
.......