C#中如何取得系统字体
来源:互联网 发布:淘宝男运动服装 编辑:程序博客网 时间:2024/06/03 00:17
<HTML>
<HEAD>
<title>systemfont</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 48px" cellSpacing="1"
cellPadding="1" width="300" border="1">
<TR>
<TD><FONT face="宋体">系统字体列表</FONT></TD>
<TD>
<asp:DropDownList id="DropDownList1" runat="server"></asp:DropDownList></TD>
<TD></TD>
</TR>
<TR>
<TD><FONT face="宋体">系统字体样式</FONT></TD>
<TD><FONT face="宋体">
<asp:DropDownList id="DropDownList2" runat="server"></asp:DropDownList></FONT></TD>
<TD></TD>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
</form>
</body>
</HTML>
<HEAD>
<title>systemfont</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 48px" cellSpacing="1"
cellPadding="1" width="300" border="1">
<TR>
<TD><FONT face="宋体">系统字体列表</FONT></TD>
<TD>
<asp:DropDownList id="DropDownList1" runat="server"></asp:DropDownList></TD>
<TD></TD>
</TR>
<TR>
<TD><FONT face="宋体">系统字体样式</FONT></TD>
<TD><FONT face="宋体">
<asp:DropDownList id="DropDownList2" runat="server"></asp:DropDownList></FONT></TD>
<TD></TD>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
</form>
</body>
</HTML>
protected System.Web.UI.WebControls.DropDownList DropDownList2;
protected System.Web.UI.WebControls.DropDownList DropDownList1;
private void Page_Load(object sender, System.EventArgs e)
{
//如何获得系统字体列表
System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
foreach (System.Drawing.FontFamily family in fonts.Families)
{
DropDownList1.Items.Add(family.Name);
}
//如何获得系统字体样式
ArrayList list=new ArrayList();
foreach(int i in Enum.GetValues(typeof(System.Drawing.FontStyle)))
{
ListItem listitem = new ListItem(Enum.GetName(typeof(System.Drawing.FontStyle),i),i.ToString());
list.Add(listitem);
}
DropDownList2.Items.Clear();
DropDownList2.DataSource=list;
DropDownList2.DataValueField="value";
DropDownList2.DataTextField="text";
DropDownList2.DataBind();
}
protected System.Web.UI.WebControls.DropDownList DropDownList1;
private void Page_Load(object sender, System.EventArgs e)
{
//如何获得系统字体列表
System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
foreach (System.Drawing.FontFamily family in fonts.Families)
{
DropDownList1.Items.Add(family.Name);
}
//如何获得系统字体样式
ArrayList list=new ArrayList();
foreach(int i in Enum.GetValues(typeof(System.Drawing.FontStyle)))
{
ListItem listitem = new ListItem(Enum.GetName(typeof(System.Drawing.FontStyle),i),i.ToString());
list.Add(listitem);
}
DropDownList2.Items.Clear();
DropDownList2.DataSource=list;
DropDownList2.DataValueField="value";
DropDownList2.DataTextField="text";
DropDownList2.DataBind();
}
- C#中如何取得系统字体
- C#中如何取得系统字体
- C#中如何取得系统字体
- C#中如何取得系统字体
- C#中如何取得并使用Windows系统图标
- WPF中取得系统字体列表
- 取得系统字体
- c#中如何取得应用程序运行路径
- c#中如何取得应用程序运行路径
- c#中如何取得应用程序运行路径
- c#中如何取得应用程序运行路径
- c#中如何取得应用程序运行路径
- c#中如何取得应用程序运行路径
- asp.net中如何取得系统参数
- C#取得系统目录
- C#取得系统目录
- 如何取得系统错误信息!
- 如何取得系统时间
- 平安夜有怀高中同学
- 阴历阳历转换
- 通过HtmlInputFile控件上传文件的类
- 股票发行的成本如何计算?与银行贷款相比谁高谁低?
- SQLDMO类的使用
- C#中如何取得系统字体
- C#条形码
- 敲锣打鼓,热烈庆祝自己学会游泳!
- 基于.net开发的项目案例
- 赠夏东,约于上岛咖啡
- Oracle数据文件位置迁移笔记
- 如何建立回到桌面的快捷方式
- SaaS(软件即服务)的魅力
- 联想网御