次の方法で共有


ControlDesigner.OnBehaviorAttached メソッド

デザイナが動作に結び付けられていると、呼び出されます。

Overrides Protected Sub OnBehaviorAttached()
[C#]
protected override void OnBehaviorAttached();
[C++]
protected: void OnBehaviorAttached();
[JScript]
protected override function OnBehaviorAttached();

使用例

[Visual Basic] PanelDesigner クラスから継承した OnBehaviorAttached メソッドをデザイナでオーバーライドするコード例を次に示します。このメソッドを呼び出すと、カスタム Panel コントロールの Wrap プロパティの値がチェックされます。これが true に設定されている場合は、このクラスのバージョンの ReadWriteControlDesigner.MapPropertyToStyle メソッドが呼び出されます。

 
' Override the OnBehaviorAttached method to call
' the MapPropertyToStyle method when the designer
' control's wrap property is set to true.       
 Overrides Protected Sub OnBehaviorAttached()

    MyBase.OnBehaviorAttached()
    
    Dim component As IComponent
  
    Dim panel As CustomPanel = CType(component, CustomPanel)
    Dim wrap As Boolean = panel.Wrap
    If wrap Then
       MapPropertyToStyle("Wrap", wrap)
    End If  
 End Sub 'OnBehaviorAttached

[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

ControlDesigner クラス | ControlDesigner メンバ | System.Web.UI.Design 名前空間