This documentation is archived and is not being maintained.

ControlDesigner.OnControlResize Method

Called when the design-time control has been resized.

[Visual Basic]
Protected Overridable Sub OnControlResize()
protected virtual void OnControlResize();
protected: virtual void OnControlResize();
protected function OnControlResize();


This method is typically only called by the design-time environment when a user action causes the control to be resized. This method may be called several times during a resize process to display the updated size of the control before the resize process is completed. The width and height properties of the control are updated before this method is called.


[Visual Basic] The following code example overrides the OnControlResize method. When the control associated with the designer is resized on the design surface, this method is called. When that occurs, the code sets the IsDirty property to true and then calls the UpdateDesignTimeHtml method.

[Visual Basic] 
' Override the OnControlResize method to
' set the IsDirty property to true and
' call the UpdateDesignTimeHtml method.      
Overrides Protected Sub OnControlResize()
  Me.IsDirty = True
End Sub

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ControlDesigner Class | ControlDesigner Members | System.Web.UI.Design Namespace