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

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

PanelContainerDesigner クラス

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

Panel コントロールを、ビジュアル デザイナで、デザイン時に使用できるようにします。

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

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

Panel コントロールは、特にコントロールプログラム生成されたときに、他のコントロールコンテナとして使用されます。

ビジュアルなデザイナで、ソース ビューからデザイン ビュー切り替えると、関連付けられた Panel コントロール記述するマークアップソース コード解析されコントロールデザインバージョンデザイン サーフェイス作成されます。元のソース ビュー切り替えると、デザイン時のコントロールマークアップソース コード保持されWeb ページマークアップ反映されます。PanelContainerDesigner クラスは、ビジュアルなデザイナで、Panel コントロールデザイン時に使用できるようにします。

FrameCaption プロパティは、関連付けられた Panel コントロール表示されるキャプション取得します。FrameStyle プロパティは、関連付けられたコントロールスタイル取得します

UsePreviewControl プロパティは、常に true返しますデザイナは、関連付けられた Panel一時的なコピー作成してデザイン時のマークアップ生成します

Initialize メソッドは、関連付けられた Panel コントロールデザイナ表示編集デザインできるように準備します。AddDesignTimeCssAttributes メソッドは、コレクション要素を、関連付けられたコントロールざまざまスタイル属性 (文字列形式) に設定します

使用例使用例

PanelContainerDesigner クラス拡張しPanel コントロールか派生したコントロール外観動作デザイン時に変更するコード例次に示します

この例では、MyPanelContainer クラスPanel コントロールか派生させています。また、PanelContainerDesigner クラスから MyPanelContainerDesigner クラス派生させ、MyPanelContainer クラスMyPanelContainerDesigner に DesignerAttribute 属性適用してます。

MyPanelContainerDesigner は、次の PanelContainerDesignerメンバオーバーライドます。

Imports System
Imports System.Web
Imports System.Web.UI.WebControls
Imports System.Web.UI.Design.WebControls
Imports System.ComponentModel
Imports System.Security.Permissions

Namespace Examples.VB.WebControls.Design

    ' The MyPanelContainer is a copy of the PanelContainer.
    <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <Designer(GetType(Examples.VB.WebControls.Design.MyPanelContainerDesigner))>
 _
    Public Class MyPanelContainer
        Inherits Panel
    End Class ' MyPanelContainer

    ' Override members of the PanelContainerDesigner.
    Public Class MyPanelContainerDesigner
        Inherits PanelContainerDesigner

        ' Provide a design-time caption for the panel.
        Public Overrides ReadOnly
 Property FrameCaption() As String
            Get
                ' If the FrameCaption is empty, use the panel control
 ID.
                Dim localCaption As String
 = MyBase.FrameCaption
                If localCaption Is Nothing
 Or localCaption = "" Then
                    localCaption = CType(Component, Panel).ID.ToString()
                End If

                Return localCaption
            End Get
        End Property ' FrameCaption

        ' Provide a design-time border style for the panel.
        Public Overrides ReadOnly
 Property FrameStyle() As Style
            Get
                Dim styleOfFrame As Style =
 MyBase.FrameStyle

                ' If no border style is defined, define one.
                If (styleOfFrame.BorderStyle = BorderStyle.NotSet
 Or _
                    styleOfFrame.BorderStyle = BorderStyle.None) Then
                    styleOfFrame.BorderStyle = BorderStyle.Outset
                End If

                Return styleOfFrame
            End Get
        End Property ' FrameStyle

        ' Initialize the designer.
        Public Overrides Sub
 Initialize(ByVal component As IComponent)

            ' Ensure that only a MyPanelContainer can be created   
            ' in this designer. 
            If Not TypeOf
 component Is MyPanelContainer Then
                Throw New ArgumentException()
            End If

            MyBase.Initialize(component)

        End Sub ' Initialize
    End Class ' MyPanelContainerDesigner
End Namespace ' Examples.VB.WebControls.Design
using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.Design.WebControls;
using System.ComponentModel;
using System.Security.Permissions;

namespace Examples.CS.WebControls.Design
{
    // The MyPanelContainer is a copy of the Panel.
    [AspNetHostingPermission(SecurityAction.Demand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [Designer(typeof(Examples.CS.WebControls.Design.MyPanelContainerDesigner))]
    public class MyPanelContainer : Panel
    {
    } // MyPanelContainer

    // Override members of the PanelContainerDesigner.
    public class MyPanelContainerDesigner :
 PanelContainerDesigner
    {
        // Provide a design-time caption for the panel.
        public override string FrameCaption
 
        {
            get
            {
                // If the FrameCaption is empty, use the panel control
 ID.
                string localCaption = base.FrameCaption;
                if (localCaption == null ||
 localCaption == "")
                    localCaption = ((Panel)Component).ID.ToString();

                return localCaption;
            }
        } // FrameCaption

        // Provide a design-time border style for the panel.
        public override Style FrameStyle
        {
            get
            {
                Style styleOfFrame = base.FrameStyle;

                // If no border style is defined, define one.
                if (styleOfFrame.BorderStyle == BorderStyle.NotSet
 ||
                    styleOfFrame.BorderStyle == BorderStyle.None)
                    styleOfFrame.BorderStyle = BorderStyle.Outset;

                return styleOfFrame;
            }
        } // FrameStyle

        // Initialize the designer.
        public override void Initialize(IComponent
 component)
        {
            // Ensure that only a MyPanelContainer can be created 
            // in this designer.
            if (!(component is MyPanelContainer))
                throw new ArgumentException();
            
            base.Initialize(component);

        } // Initialize
    } // MyPanelContainerDesigner
} // Examples.CS.WebControls.Design
継承階層継承階層
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.PanelContainerDesigner
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「PanelContainerDesigner クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS