ControlDesigner.SetEditableDesignerRegionContent メソッド
アセンブリ: System.Design (system.design.dll 内)

Public Overridable Sub SetEditableDesignerRegionContent ( _ region As EditableDesignerRegion, _ content As String _ )
Dim instance As ControlDesigner Dim region As EditableDesignerRegion Dim content As String instance.SetEditableDesignerRegionContent(region, content)
public virtual void SetEditableDesignerRegionContent ( EditableDesignerRegion region, string content )
public: virtual void SetEditableDesignerRegionContent ( EditableDesignerRegion^ region, String^ content )
public function SetEditableDesignerRegionContent ( region : EditableDesignerRegion, content : String )

ControlDesigner クラスから派生したクラスでは、デザイン サーフェイスでの領域ベースの編集をサポートでき、SetEditableDesignerRegionContent をオーバーライドして指定した領域の内容を設定できます。

デザイン ホストへの参照を取得し、その参照を使用して、content を ITemplate インターフェイスのインスタンスに変更し、ITemplate を適切なビューに割り当てる ControlParser オブジェクトを作成する方法のコード例を次に示します。
' Create a template from the content string and put it ' in the selected view. Called by the designer host? Public Overrides Sub SetEditableDesignerRegionContent(ByVal region As EditableDesignerRegion, ByVal content As String) If IsNothing(content) Then Return End If ' Get a reference to the designer host Dim host As IDesignerHost = CType(Component.Site.GetService(GetType(IDesignerHost)), IDesignerHost) If Not IsNothing(host) Then ' Create a template from the content string Dim template As ITemplate = ControlParser.ParseTemplate(host, content) If Not IsNothing(template) Then ' Determine which region should get the template If region.Name.EndsWith("0") Then myControl.View1 = template ElseIf region.Name.EndsWith("1") Then myControl.View2 = template End If End If End If End Sub
// Create a template from the content string and // put it in the selected view. public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content) { if (content == null) return; // Get a reference to the designer host IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost)); if (host != null) { // Create a template from the content string ITemplate template = ControlParser.ParseTemplate(host, content); if (template != null) { // Determine which region should get the template // Either 'Content0' or 'Content1' if (region.Name.EndsWith("0")) myControl.View1 = template; else if (region.Name.EndsWith("1")) myControl.View2 = template; } } }


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からControlDesigner.SetEditableDesignerRegionContent メソッドを検索する場合は、下記のリンクをクリックしてください。

- ControlDesigner.SetEditableDesignerRegionContent メソッドのページへのリンク