ContainerControlDesigner クラスとは? わかりやすく解説

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

ContainerControlDesigner クラス

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

デザイン時に変更できるコントロールまたはプロパティを含むコントロールに対してデザイナ機能提供します

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

Public Class ContainerControlDesigner
    Inherits ControlDesigner
Dim instance As ContainerControlDesigner
public class ContainerControlDesigner : ControlDesigner
public ref class ContainerControlDesigner :
 public ControlDesigner
public class ContainerControlDesigner extends
 ControlDesigner
public class ContainerControlDesigner extends
 ControlDesigner
解説解説

ContainerControlDesigner クラスは、デザイン サーフェイス変更できるコントロール基本デザイナ クラス提供します。これには、子コントロールを含むコントロール、または編集可能な内部プロパティ含まれます。ContainerControlDesigner は、コントロールを表すための単一フレーム領域提供しデザイン時のコントロール描画自動的に処理します

ContainerControlDesignerデザイン時の動作調べるには、関連するコントロールに ParseChildrenAttribute 属性適用します。ParseChildrenAttribute 設定を、次のように関連するコントロール適用します。

コントロール開発者は、開発中コントロール種類に応じて次の一覧で定義されている複数基本デザイナのうちの 1 つからカスタム デザイナ派生または拡張できます

メモメモ

ContainerControlDesigner クラスは、使用中となった ReadWriteControlDesigner クラス代わるものです。

カスタム デザイナ クラスカスタム コントロール実装と共に関連付けるには、DesignerAttribute 属性使用しますカスタム コントロールコントロール デザイナ使用する方法詳細については、「チュートリアル : Web サーバー コントロール用の基本的なコントロール デザイナ作成」を参照してください

使用例使用例

ContainerControlDesigner クラスからデザイナ クラス派生する方法次のコード例示します。この例では、CompositeControl クラスから派生した単純なコントロール定義し次に ContainerControlDesigner クラスから派生した関連デザイナ定義してます。派生デザイナ クラスは、FrameCaption プロパティと FrameStyle プロパティオーバーライドして、デザイン サーフェイス上のコントロール編集可能な領域周囲フレームカスタマイズます。

Imports Microsoft.VisualBasic
Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Collections
Imports System.Drawing
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Imports System.Web.UI.WebControls

Namespace ControlDesignerSamples.VB


    ' Define a simple composite control, derived from the 
    ' System.Web.UI.WebControls.CompositeControl class.

    <Designer(GetType(SimpleContainerControlDesigner)), _
     ParseChildren(False)> _
    Public Class SimpleContainerControl
        Inherits CompositeControl

    End Class


    ' Define the designer for the simple composite control.
    ' The designer derives from System.Web.UI.Design.ContainerControlDesigner.
    ' The designer defines the style and caption for the frame around
 the 
    ' editable region of the control in the design surface.
    Public Class SimpleContainerControlDesigner
        Inherits ContainerControlDesigner

        Private _style As Style = Nothing

        ' Define the caption text for the frame in the design surface.
        Public Overrides ReadOnly
 Property FrameCaption() As String
            Get
                Return "- My simple container
 control -"
            End Get
        End Property


        ' Define the style of the frame around the control in the design
 surface.
        Public Overrides ReadOnly
 Property FrameStyle() As Style
            Get
                If _style Is Nothing
 Then

                    _style = New Style()
                    _style.Font.Name = "Verdana"
                    _style.Font.Size = New FontUnit("XSmall")
                    _style.BackColor = Color.LavenderBlush
                    _style.ForeColor = Color.DarkBlue
                End If

                Return _style
            End Get
        End Property


    End Class

End Namespace
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
using System.Web.UI.WebControls;

namespace ControlDesignerSamples.CS
{

    // Define a simple composite control, derived from the 
    // System.Web.UI.WebControls.CompositeControl class.
    [
        Designer(typeof(SimpleContainerControlDesigner)) , 
        ParseChildren(false)
    ]
    public class SimpleContainerControl : CompositeControl
    {
    }


    // Define the designer for the simple composite control.
    // The designer derives from System.Web.UI.Design.ContainerControlDesigner.
    // The designer defines the style and caption for frame around the
 
    // editable region in the design surface.
    public class SimpleContainerControlDesigner
 : ContainerControlDesigner
    {
        private Style _style = null;

        // Define the caption text for the frame in the design surface.
        public override string FrameCaption
        {
            get
            {
                return "= My simple container control =";
            }
        }

        // Define the style of the frame around the control in the design
 surface.
        public override Style FrameStyle
        {
            get
            {
                if (_style == null)
                {
                    _style = new Style();
                    _style.Font.Name = "Verdana";
                    _style.Font.Size = new FontUnit("XSmall");
                    _style.BackColor = Color.LavenderBlush;
                    _style.ForeColor = Color.DarkBlue;
                }

                return _style;
            }
        }
    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.ComponentModel.Design.ComponentDesigner
     System.Web.UI.Design.HtmlControlDesigner
       System.Web.UI.Design.ControlDesigner
        System.Web.UI.Design.ContainerControlDesigner
           System.Web.UI.Design.WebControls.MultiViewDesigner
           System.Web.UI.Design.WebControls.PanelContainerDesigner
           System.Web.UI.Design.WebControls.ViewDesigner
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ContainerControlDesigner メンバ
System.Web.UI.Design 名前空間
ControlDesigner
CompositeControlDesigner
EditableDesignerRegion
Panel
PanelContainerDesigner
その他の技術情報
ASP.NET コントロール デザイナ概要
属性デザインサポート
Web フォームデザインサポート



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

辞書ショートカット

すべての辞書の索引

「ContainerControlDesigner クラス」の関連用語

ContainerControlDesigner クラスのお隣キーワード
検索ランキング

   

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



ContainerControlDesigner クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS