Login.CheckBoxStyle 属性

定义

获取对 Style 对象的引用,它定义“记住我”复选框的设置。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ CheckBoxStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle CheckBoxStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.CheckBoxStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property CheckBoxStyle As TableItemStyle

属性值

Style 的引用,它定义 Login 控件的“记住我”复选框的样式设置。

属性

示例

下面的代码示例通过设置 属性引用CheckBoxStyle的 对象的属性Style,将“记住我”复选框的文本颜色设置为蓝色,并将字体样式设置为斜体。

<%@ Page Language="C#" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
        void Page_Load(Object sender, EventArgs e) 
        {
            Login1.CheckBoxStyle.ForeColor = System.Drawing.Color.Blue;
        }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
        <form id="form1" runat="server">
            <asp:Login id="Login1" runat="server">
                <CheckBoxStyle Font-Italic="True"></CheckBoxStyle>
            </asp:Login>

        </form>
    </body>
</html>
<%@ Page Language="VB" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
        Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            Login1.CheckBoxStyle.ForeColor = System.Drawing.Color.Blue
        End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
        <form id="form1" runat="server">
            <asp:Login id="Login1" runat="server">
                <CheckBoxStyle Font-Italic="True"></CheckBoxStyle>
            </asp:Login>

        </form>
    </body>
</html>

注解

属性 CheckBoxStyle 获取对 Style 对象的引用,该对象用于更改控件的“记住我”复选框的外观 Login

此属性是只读的;但是,可以设置它返回的对象 Style 的属性。 可以在 窗体 Property-Subproperty中以声明方式设置这些属性,其中 Subproperty 表示 Style 类 (例如 CheckBoxStyle-ForeColor) 的属性。 可以编程方式在窗体 Property.Subproperty 中 (设置 属性, CheckBoxStyle.ForeColor 例如,) 。

常见设置包括自定义背景色、文本颜色和字体属性。 属性 CheckBoxStyle 定义 属性的外观 RememberMeText

属性的 CheckBoxStyle 样式设置与控件的样式设置 Login 合并。 在 属性中 CheckBoxStyle 所做的任何设置都覆盖控件属性 Login 中的相应设置。

设置将覆盖CheckBoxStyle以下Login控件样式属性:

使用模板定义控件的外观 Login 时, CheckBoxStyle 属性不起作用。

适用于

另请参阅