<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 = ""> system font list </font> </TD>
<TD>
<Asp: dropdownlist id = "dropdownlist1" runat = "server"> </ASP: dropdownlist> </TD>
<TD> </TD>
</Tr>
<Tr>
<TD> <font face = ""> system font style </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)
{
// How to obtain the system font list
System. Drawing. Text. installedfontcollection fonts = new system. Drawing. Text. installedfontcollection ();
Foreach (system. Drawing. fontfamily family in fonts. Families)
{
Dropdownlist1.items. Add (family. Name );
}
// How to obtain the system Font Style
Arraylist list = new arraylist ();
Foreach (int I in Enum. getvalues (typeof (system. Drawing. fontstyle )))
{
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 ();
}