This documentation is archived and is not being maintained.
PanelDesigner.OnBehaviorAttached Method
.NET Framework 1.1
Provides notification when a behavior is attached to the designer.
[Visual Basic] Overrides Protected Sub OnBehaviorAttached() [C#] protected override void OnBehaviorAttached(); [C++] protected: void OnBehaviorAttached(); [JScript] protected override function OnBehaviorAttached();
Example
[Visual Basic] The following code example overrides the OnBehaviorAttached method to check the value of the Wrap for the instance of the CustomPanel class that is being displayed by the designer. If the value is true, the MapPropertyToStyle method is called.
[Visual Basic]
' 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] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
.NET Framework Security:
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries From Partially Trusted Code
See Also
PanelDesigner Class | PanelDesigner Members | System.Web.UI.Design.WebControls Namespace
Show: