Set font name, size and style for asp:dropdownlist (VB.net)
<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Working with the Appearance of a DropDownList Control</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<BR><BR>
<B>Select a Color:</B><BR>
<BR><BR>
<asp:dropdownlist
id="ddl1"
accesskey="1"
runat="server"
>
<asp:listitem value="Bu">Blue</asp:listitem>
<asp:listitem value="Re">Red</asp:listitem>
<asp:listitem value="Gr">Green</asp:listitem>
<asp:listitem value="Pu" Selected>Purple</asp:listitem>
<asp:listitem value="Ba">Black</asp:listitem>
<asp:listitem value="Go" text="Gold"/>
</asp:dropdownlist>
<BR><BR>
<asp:dropdownlist
id="ddl2"
font-name="Comic Sans MS"
font-size="9pt"
font-bold="True"
backcolor="lightyellow"
runat="server"
>
<asp:listitem value="Bu">Blue</asp:listitem>
<asp:listitem value="Re">Red</asp:listitem>
<asp:listitem value="Gr">Green</asp:listitem>
<asp:listitem value="SR" Selected>Bright Orange Green with Red</asp:listitem>
<asp:listitem value="Ba">Black</asp:listitem>
<asp:listitem value="Go" text="Gold"/>
</asp:dropdownlist>
<BR><BR>
<asp:dropdownlist
id="ddl3"
backcolor="darkred"
forecolor="yellow"
runat="server"
>
<asp:listitem value="Bu">Blue</asp:listitem>
<asp:listitem value="Re">Red</asp:listitem>
<asp:listitem value="Gr">Green</asp:listitem>
<asp:listitem value="Pu" Selected>Purple</asp:listitem>
<asp:listitem value="Ba">Black</asp:listitem>
<asp:listitem value="Go" text="Gold"/>
</asp:dropdownlist>
</form>
</BODY>
</HTML>
Related examples in the same category