ASP.NET ForeColor属性

定义和用法

ForeColor属性用于设置或返回控件的前景色(通常是文本的颜色)。

语法

<asp:webcontrol id="id" ForeColor="color" runat="server" />
属性 描述
color 设置为控件前景色的颜色。必须是合法的 HTML颜色

实例

下面的例子设置了按钮的前景色:

<form runat="server">
<asp:Button id="button1" Text="Submit" 
ForeColor="#FF0000" runat="server" />
</form>

实例

设置Button控件的ForeColor
设置Button控件的ForeColor(带有声明和脚本)