DesignerAutoFormat.Apply メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DesignerAutoFormat.Apply メソッドの意味・解説 

DesignerAutoFormat.Apply メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

関連付けられている書式指定したコントロール適用します。

名前空間: System.Web.UI.Design
アセンブリ: System.Design (system.design.dll 内)
構文構文

解説解説
使用例使用例

DesignerAutoFormat オブジェクト使用して Web サーバー コントロール書式適用する方法次のコード例示します

' Applies styles based on the Name of the AutoFormat
Public Overrides Sub Apply(ByVal
 inLabel As Control)
    If TypeOf inLabel Is
 IndentLabel Then
        Dim ctl As IndentLabel = CType(inLabel,
 IndentLabel)

        ' Apply formatting according to the Name
        If Me.Name.Equals("MyClassic")
 Then
            ' For MyClassic, apply style elements directly to the control
            ctl.ForeColor = Color.Gray
            ctl.BackColor = Color.LightGray
            ctl.Font.Size = FontUnit.XSmall
            ctl.Font.Name = "Verdana,Geneva,Sans-Serif"
        ElseIf Me.Name.Equals("MyBright")
 Then
            ' For MyBright, apply style elements to the Style object
            Me.Style.ForeColor = Color.Maroon
            Me.Style.BackColor = Color.Yellow
            Me.Style.Font.Size = FontUnit.Medium

            ' Merge the AutoFormat style with the control's style
            ctl.MergeStyle(Me.Style)
        Else
            ' For the Default format, apply style elements to the control
            ctl.ForeColor = Color.Black
            ctl.BackColor = Color.Empty
            ctl.Font.Size = FontUnit.XSmall
        End If
    End If
End Sub
// Applies styles based on the Name of the AutoFormat
public override void Apply(Control inLabel)
{
    if (inLabel is IndentLabel)
    {
        IndentLabel ctl = (IndentLabel)inLabel;

        // Apply formatting according to the Name
        if (this.Name == "MyClassic")
        {
            // For MyClassic, apply style elements directly to the control
            ctl.ForeColor = Color.Gray;
            ctl.BackColor = Color.LightGray;
            ctl.Font.Size = FontUnit.XSmall;
            ctl.Font.Name = "Verdana,Geneva,Sans-Serif";
        }
        else if (this.Name
 == "MyBright")
        {
            // For MyBright, apply style elements to the Style property
            this.Style.ForeColor = Color.Maroon;
            this.Style.BackColor = Color.Yellow;
            this.Style.Font.Size = FontUnit.Medium;

            // Merge the AutoFormat style with the control's style
            ctl.MergeStyle(this.Style);
        }
        else
        {
            // For the Default format, apply style elements to the control
            ctl.ForeColor = Color.Black;
            ctl.BackColor = Color.Empty;
            ctl.Font.Size = FontUnit.XSmall;
        }
    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerAutoFormat クラス
DesignerAutoFormat メンバ
System.Web.UI.Design 名前空間
DesignerAutoFormat クラス
ControlDesigner クラス
DesignerAutoFormatCollection
その他の技術情報
Web フォームデザインサポート



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DesignerAutoFormat.Apply メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DesignerAutoFormat.Apply メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS