Style クラス

定義

Web サーバー コントロールのスタイルを表します。

public ref class Style : System::ComponentModel::Component, System::Web::UI::IStateManager
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class Style : System.ComponentModel.Component, System.Web.UI.IStateManager
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.EmptyStringExpandableObjectConverter))]
public class Style : System.ComponentModel.Component, System.Web.UI.IStateManager
[<System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))>]
type Style = class
    inherit Component
    interface IStateManager
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.EmptyStringExpandableObjectConverter))>]
type Style = class
    inherit Component
    interface IStateManager
Public Class Style
Inherits Component
Implements IStateManager
継承
派生
属性
実装

この例では、オブジェクトを使用 Style して複数のコントロールのスタイル プロパティを一度に変更する方法を示します。 プロパティ値の Style 1 つが変更されるたびに、各コントロールがそのメソッドを ApplyStyle 呼び出す必要があります。 含まれるすべてのコントロールが、示されているすべてのプロパティをサポートしているわけではないことに注意してください。 コントロールが特定のプロパティをサポートしていない場合、プロパティ値が変更されてもコントロールの外観は変更されません。

注意

次のコード サンプルでは、シングル ファイル コード モデルを使用します。分離コード ファイルに直接コピーした場合、正しく動作しない場合があります。 このコード サンプルは、拡張子が .aspx の空のテキスト ファイルにコピーする必要があります。 Web Forms コード モデルの詳細については、「ページ コード モデルの ASP.NET Web Forms」を参照してください。

<!--  -->
<!-- -->
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    private Style primaryStyle = new Style();

    void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // Add data to the borderColorList, 
            // backColorList, and foreColorList controls.
            ListItemCollection colors = new ListItemCollection();
            colors.Add(Color.Black.Name);
            colors.Add(Color.Blue.Name);
            colors.Add(Color.Green.Name);
            colors.Add(Color.Orange.Name);
            colors.Add(Color.Purple.Name);
            colors.Add(Color.Red.Name);
            colors.Add(Color.White.Name);
            colors.Add(Color.Yellow.Name);
            borderColorList.DataSource = colors;
            borderColorList.DataBind();
            backColorList.DataSource = colors;
            backColorList.DataBind();
            foreColorList.DataSource = colors;
            foreColorList.DataBind();
            //<Snippet4>              

            // Add data to the borderStyleList control.
            ListItemCollection styles = new ListItemCollection();
            Type styleType = typeof(BorderStyle);
            foreach (string s in Enum.GetNames(styleType))
            {
                styles.Add(s);
            }
            borderStyleList.DataSource = styles;
            borderStyleList.DataBind();
            //</Snippet4>           

            // Add data to the borderWidthList control.
            ListItemCollection widths = new ListItemCollection();
            for (int i = 0; i < 11; i++)
            {
                widths.Add(i.ToString() + "px");
            }
            borderWidthList.DataSource = widths;
            borderWidthList.DataBind();

            // Add data to the fontNameList control.
            ListItemCollection names = new ListItemCollection();
            names.Add("Arial");
            names.Add("Courier");
            names.Add("Garamond");
            names.Add("Times New Roman");
            names.Add("Verdana");
            fontNameList.DataSource = names;
            fontNameList.DataBind();

            // Add data to the fontSizeList control.
            ListItemCollection fontSizes = new ListItemCollection();
            fontSizes.Add("Small");
            fontSizes.Add("Medium");
            fontSizes.Add("Large");
            fontSizes.Add("10pt");
            fontSizes.Add("14pt");
            fontSizes.Add("20pt");
            fontSizeList.DataSource = fontSizes;
            fontSizeList.DataBind();

            //Set primaryStyle as the style for each control.
            Label1.ApplyStyle(primaryStyle);
            ListBox1.ApplyStyle(primaryStyle);
            Button1.ApplyStyle(primaryStyle);
            Table1.ApplyStyle(primaryStyle);
            TextBox1.ApplyStyle(primaryStyle);
        }
    }
    //<Snippet5>
    void ChangeBorderColor(object sender, System.EventArgs e)
    {
        primaryStyle.BorderColor =
            Color.FromName(borderColorList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet5>

    //<Snippet6>
    void ChangeBackColor(object sender, System.EventArgs e)
    {
        primaryStyle.BackColor =
            Color.FromName(backColorList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet6>

    //<Snippet7>
    void ChangeForeColor(object sender, System.EventArgs e)
    {
        primaryStyle.ForeColor =
            Color.FromName(foreColorList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet7>

    //<Snippet8>
    void ChangeBorderStyle(object sender, System.EventArgs e)
    {
        primaryStyle.BorderStyle =
            (BorderStyle)Enum.Parse(typeof(BorderStyle),
            borderStyleList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet8>

    //<Snippet9>
    void ChangeBorderWidth(object sender, System.EventArgs e)
    {
        primaryStyle.BorderWidth =
            Unit.Parse(borderWidthList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet9>

    //<Snippet10>
    void ChangeFont(object sender, System.EventArgs e)
    {
        primaryStyle.Font.Name =
            fontNameList.SelectedItem.Text;
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet10>

    //<Snippet11>
    void ChangeFontSize(object sender, System.EventArgs e)
    {
        primaryStyle.Font.Size =
            FontUnit.Parse(fontSizeList.SelectedItem.Text);
        Label1.ApplyStyle(primaryStyle);
        ListBox1.ApplyStyle(primaryStyle);
        Button1.ApplyStyle(primaryStyle);
        Table1.ApplyStyle(primaryStyle);
        TextBox1.ApplyStyle(primaryStyle);
    }
    //</Snippet11>
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <table cellpadding="6" border="0">
        <tr>
            <td rowspan="10" style="border:solid 1px Gray">
                <p>
                    <asp:label id="Label1" 
                        Text="Border Properties Example" Runat="server">
                        Label Styles
                    </asp:label>
                </p>
                <p>
                    <asp:button id="Button1" runat="server" 
                        Text="Button Styles">
                    </asp:button>
                </p>
                <p>
                    <asp:listbox id="ListBox1" Runat="server">
                        <asp:ListItem Value="0" Text="List Item 0">
                        </asp:ListItem>
                        <asp:ListItem Value="1" Text="List Item 1">
                        </asp:ListItem>
                        <asp:ListItem Value="2" Text="List Item 2">
                        </asp:ListItem>
                    </asp:listbox>
                </p>
                <p>
                    <asp:textbox id="TextBox1" 
                        Text="TextBox Styles" Runat="server">
                    </asp:textbox>
                </p>
                <p>
                    <asp:table id="Table1" Runat="server">
                        <asp:TableRow>
                            <asp:TableCell Text="(0,0)"></asp:TableCell>
                            <asp:TableCell Text="(0,1)"></asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell Text="(1,0)"></asp:TableCell>
                            <asp:TableCell Text="(1,1)"></asp:TableCell>
                        </asp:TableRow>
                    </asp:table>
                </p>
            </td>
            <td align="right">
                <asp:Label ID="Label2" runat="server" 
                    AssociatedControlID="borderColorList" 
                    Text="Border Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderColorList" 
                    Runat="server" AutoPostBack="True" 
                    OnSelectedIndexChanged="ChangeBorderColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label3" Runat="server" 
                    AssociatedControlID="borderStyleList"
                    Text="Border Style:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderStyleList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBorderStyle">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label4" Runat="server" 
                    AssociatedControlID="borderWidthList"
                    Text="Border Width">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderWidthList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBorderWidth">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label5" Runat="server" 
                    AssociatedControlID="backColorList"
                    Text="Back Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="backColorList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBackColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label6" Runat="server" 
                    AssociatedControlID="foreColorList"
                    Text="Foreground Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="foreColorList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeForeColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label7" Runat="server" 
                    AssociatedControlID="fontNameList"
                    Text="Font Name:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="fontNameList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeFont">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label8" Runat="server" 
                    AssociatedControlID="fontSizeList"
                    Text="Font Size:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="fontSizeList" 
                    Runat="server" AutoPostBack="True" 
                    OnSelectedIndexChanged="ChangeFontSize">
                </asp:dropdownlist>
            </td>
        </tr>
    </table>

    </div>
    </form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Drawing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Private primaryStyle As New Style()

    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not Page.IsPostBack Then
            ' Add data to the borderColorList, 
            ' backColorList, and foreColorList controls.
            Dim colors As New ListItemCollection()
            colors.Add(Color.Black.Name)
            colors.Add(Color.Blue.Name)
            colors.Add(Color.Green.Name)
            colors.Add(Color.Orange.Name)
            colors.Add(Color.Purple.Name)
            colors.Add(Color.Red.Name)
            colors.Add(Color.White.Name)
            colors.Add(Color.Yellow.Name)
            borderColorList.DataSource = colors
            borderColorList.DataBind()
            backColorList.DataSource = colors
            backColorList.DataBind()
            foreColorList.DataSource = colors
            foreColorList.DataBind()
                
            '<Snippet4>
            ' Add data to the borderStyleList control.
            Dim styles As New ListItemCollection()
            Dim styleType As Type = GetType(BorderStyle)
            Dim s As String
            For Each s In [Enum].GetNames(styleType)
                styles.Add(s)
            Next s
            borderStyleList.DataSource = styles
            borderStyleList.DataBind()
            '</Snippet4>           

            ' Add data to the borderWidthList control.
            Dim widths As New ListItemCollection()
            Dim i As Integer
            For i = 0 To 10
                widths.Add(i.ToString() & "px")
            Next i
            borderWidthList.DataSource = widths
            borderWidthList.DataBind()

            ' Add data to the fontNameList control.
            Dim names As New ListItemCollection()
            names.Add("Arial")
            names.Add("Courier")
            names.Add("Garamond")
            names.Add("Times New Roman")
            names.Add("Verdana")
            fontNameList.DataSource = names
            fontNameList.DataBind()

            ' Add data to the fontSizeList control.
            Dim fontSizes As New ListItemCollection()
            fontSizes.Add("Small")
            fontSizes.Add("Medium")
            fontSizes.Add("Large")
            fontSizes.Add("10pt")
            fontSizes.Add("14pt")
            fontSizes.Add("20pt")
            fontSizeList.DataSource = fontSizes
            fontSizeList.DataBind()
                    
            ' Set primaryStyle as the style for each control.
            Label1.ApplyStyle(primaryStyle)
            ListBox1.ApplyStyle(primaryStyle)
            Button1.ApplyStyle(primaryStyle)
            Table1.ApplyStyle(primaryStyle)
            TextBox1.ApplyStyle(primaryStyle)
        End If
    End Sub

    '<Snippet5>
    Sub ChangeBorderColor(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.BorderColor = _
            Color.FromName(borderColorList.SelectedItem.Text)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet5>

    '<Snippet6>    
    Sub ChangeBackColor(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.BackColor = _
            Color.FromName(backColorList.SelectedItem.Text)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet6>

    '<Snippet7>
    Sub ChangeForeColor(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.ForeColor = _
            Color.FromName(foreColorList.SelectedItem.Text)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet7>

    '<Snippet8>
    Sub ChangeBorderStyle(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.BorderStyle = _
            CType([Enum].Parse(GetType(BorderStyle), _
            borderStyleList.SelectedItem.Text), BorderStyle)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet8>

    '<Snippet9>
    Sub ChangeBorderWidth(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.BorderWidth = _
            Unit.Parse(borderWidthList.SelectedItem.Text)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet9>

    '<Snippet10>
    Sub ChangeFont(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.Font.Name = _
            fontNameList.SelectedItem.Text
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet10>

    '<Snippet11>
    Sub ChangeFontSize(ByVal sender As Object, ByVal e As System.EventArgs)
        primaryStyle.Font.Size = _
            FontUnit.Parse(fontSizeList.SelectedItem.Text)
        Label1.ApplyStyle(primaryStyle)
        ListBox1.ApplyStyle(primaryStyle)
        Button1.ApplyStyle(primaryStyle)
        Table1.ApplyStyle(primaryStyle)
        TextBox1.ApplyStyle(primaryStyle)
    End Sub
    '</Snippet11>
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Applied Style Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <table cellpadding="6" border="0">
        <tr>
            <td rowspan="10" style="border:solid 1px Gray">
                <p>
                    <asp:label id="Label1" 
                        Text="Border Properties Example" Runat="server">
                        Label Styles
                    </asp:label>
                </p>
                <p>
                    <asp:button id="Button1" runat="server" 
                        Text="Button Styles">
                    </asp:button>
                </p>
                <p>
                    <asp:listbox id="ListBox1" Runat="server">
                        <asp:ListItem Value="0" Text="List Item 0">
                        </asp:ListItem>
                        <asp:ListItem Value="1" Text="List Item 1">
                        </asp:ListItem>
                        <asp:ListItem Value="2" Text="List Item 2">
                        </asp:ListItem>
                    </asp:listbox>
                </p>
                <p>
                    <asp:textbox id="TextBox1" 
                        Text="TextBox Styles" Runat="server">
                    </asp:textbox>
                </p>
                <p>
                    <asp:table id="Table1" Runat="server">
                        <asp:TableRow>
                            <asp:TableCell Text="(0,0)"></asp:TableCell>
                            <asp:TableCell Text="(0,1)"></asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell Text="(1,0)"></asp:TableCell>
                            <asp:TableCell Text="(1,1)"></asp:TableCell>
                        </asp:TableRow>
                    </asp:table>
                </p>
            </td>
            <td align="right">
                <asp:Label ID="Label2" runat="server" 
                    AssociatedControlID="borderColorList" 
                    Text="Border Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderColorList" 
                    Runat="server" AutoPostBack="True" 
                    OnSelectedIndexChanged="ChangeBorderColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label3" Runat="server" 
                    AssociatedControlID="borderStyleList"
                    Text="Border Style:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderStyleList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBorderStyle">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label4" Runat="server" 
                    AssociatedControlID="borderWidthList"
                    Text="Border Width">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="borderWidthList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBorderWidth">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label5" Runat="server" 
                    AssociatedControlID="backColorList"
                    Text="Back Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="backColorList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeBackColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label6" Runat="server" 
                    AssociatedControlID="foreColorList"
                    Text="Foreground Color:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="foreColorList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeForeColor">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label7" Runat="server" 
                    AssociatedControlID="fontNameList"
                    Text="Font Name:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="fontNameList" 
                    Runat="server" AutoPostBack="True"
                    OnSelectedIndexChanged="ChangeFont">
                </asp:dropdownlist>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label8" Runat="server" 
                    AssociatedControlID="fontSizeList"
                    Text="Font Size:">
                </asp:Label>
            </td>
            <td>
                <asp:dropdownlist id="fontSizeList" 
                    Runat="server" AutoPostBack="True" 
                    OnSelectedIndexChanged="ChangeFontSize">
                </asp:dropdownlist>
            </td>
        </tr>
    </table>

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

注釈

このクラスは Style 、Web サーバー コントロールの外観を制御するプロパティをカプセル化し、一般的な外観を提供するために複数の Web サーバー コントロールに適用できます。 コントロールの背景色とフォントの色を指定するには、それぞれプロパティをBackColorForeColor設定します。 罫線を表示できるコントロールでは、罫線の幅、罫線のスタイル、および罫線の色を制御するには、プロパティ 、およびBorderColorプロパティBorderStyleBorderWidth設定します。 Web サーバー コントロールのサイズは、プロパティをWidth使用Heightして指定することもできます。

コンストラクター

Style()

既定値を使用して Style クラスの新しいインスタンスを初期化します。

Style(StateBag)

指定した状態バッグ情報を使用して、Style クラスの新しいインスタンスを初期化します。

プロパティ

BackColor

Web サーバー コントロールの背景色を取得または設定します。

BorderColor

Web サーバー コントロールの境界線の色を取得または設定します。

BorderStyle

Web サーバー コントロールの境界線スタイルを取得または設定します。

BorderWidth

Web サーバー コントロールの境界線の幅を取得または設定します。

CanRaiseEvents

コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。

(継承元 Component)
Container

IContainer を含む Component を取得します。

(継承元 Component)
CssClass

クライアントで Web サーバー コントロールによって表示されるカスケード スタイル シート (CSS: Cascading Style Sheet) クラスを取得または設定します。

DesignMode

Component が現在デザイン モードかどうかを示す値を取得します。

(継承元 Component)
Events

Component に結び付けられているイベント ハンドラーのリストを取得します。

(継承元 Component)
Font

Web サーバー コントロールに関連付けられたフォント プロパティを取得します。

ForeColor

Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。

Height

Web サーバー コントロールの高さを取得または設定します。

IsEmpty

保護されているプロパティ。 スタイル要素が状態バッグで定義されているかどうかを示す値を取得します。

IsTrackingViewState

スタイル要素が状態バッグで定義されているかどうかを示す値を返します。

RegisteredCssClass

コントロールに登録されているカスケード スタイル シート (CSS) を取得します。

Site

ComponentISite を取得または設定します。

(継承元 Component)
ViewState

スタイル要素を保持している状態バックを取得します。

Width

Web サーバー コントロールの幅を取得または設定します。

メソッド

AddAttributesToRender(HtmlTextWriter)

指定した HtmlTextWriter に表示する必要のある HTML 属性およびスタイルを追加します。 このメソッドは、主にコントロールの開発者によって使用されます。

AddAttributesToRender(HtmlTextWriter, WebControl)

指定した HtmlTextWriter と Web サーバー コントロールに、表示する必要のある HTML 属性およびスタイルを追加します。 このメソッドは、主にコントロールの開発者によって使用されます。

CopyFrom(Style)

指定した Style のスタイル プロパティをこのメソッドの呼び出し元である Style クラスのインスタンスに複製します。

CreateObjRef(Type)

リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。

(継承元 MarshalByRefObject)
Dispose()

Component によって使用されているすべてのリソースを解放します。

(継承元 Component)
Dispose(Boolean)

Component によって使用されているアンマネージド リソースを解放し、オプションでマネージド リソースも解放します。

(継承元 Component)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FillStyleAttributes(CssStyleCollection, IUrlResolutionService)

指定されたオブジェクトのスタイル プロパティを CssStyleCollection オブジェクトに追加します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetLifetimeService()
互換性のために残されています。

対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
GetService(Type)

Component またはその Container で提供されるサービスを表すオブジェクトを返します。

(継承元 Component)
GetStyleAttributes(IUrlResolutionService)

指定された CssStyleCollection 実装オブジェクトの IUrlResolutionService オブジェクトを取得します。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
InitializeLifetimeService()
互換性のために残されています。

このインスタンスの有効期間ポリシーを制御する有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
LoadViewState(Object)

以前に保存した状態を読み込みます。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MemberwiseClone(Boolean)

現在の MarshalByRefObject オブジェクトの簡易コピーを作成します。

(継承元 MarshalByRefObject)
MergeWith(Style)

指定した Style のスタイル プロパティをこのメソッドの呼び出し元である Style クラスのインスタンスに結合します。

Reset()

定義されたスタイル要素を状態バッグから削除します。

SaveViewState()

保護されているメソッド。 TrackViewState() メソッドの呼び出し後に変更された状態をすべて保存します。

SetBit(Int32)

保護されている内部メソッド。 状態バッグに格納されているスタイル プロパティを示す内部ビットマスク フィールドを設定します。

SetDirty()

Style にマークを付けて、その状態がビューステートに記録されるようにします。

ToString()

現在のオブジェクトを表す文字列を返します。

ToString()

Component の名前 (存在する場合) を格納する String を返します。 このメソッドはオーバーライドできません。

(継承元 Component)
TrackViewState()

保護されているメソッド。 状態変化の追跡の開始位置をコントロールにマークします。 追跡の開始後に加えられた変更はすべて追跡され、コントロールのビューステートの一部として保存されます。

events

Disposed

Dispose() メソッドの呼び出しによってコンポーネントが破棄されるときに発生します。

(継承元 Component)

明示的なインターフェイスの実装

IStateManager.IsTrackingViewState

サーバー コントロールがビューステートの変更を追跡しているかどうかを示す値を取得します。

IStateManager.LoadViewState(Object)

以前に保存した状態を読み込みます。

IStateManager.SaveViewState()

状態の変化を示すオブジェクトを返します。

IStateManager.TrackViewState()

状態変化の追跡を開始します。

適用対象

こちらもご覧ください