Home > Language Reference > Classes > UserControl
Resize Event
Event raised when the control is resized.
Syntax
Protected Event Resize(ByVal iWidth As Integer, ByVal iHeight As Integer)
| Parameter | Description |
| iWidth | New width of the control, expressed in standard coordinates. |
| iHeight | New height of the control, expressed in standard coordinates. |
Remarks
The Resize event is sent first just after the control is loaded, and then each time it is resized. This can occurs either because of the user opening and closing the dynamic input area, or either because of calling the Move method programmatically.
The iWidth and iHeight parameters passed along with the event respectively contain the new width and height of the control, expressed in standard coordinates.
This event is typically used to allocated a bitmap for double-buffering. For example:
Private bm As New Bitmap Private Sub UserControl_Resize(ByVal iWidth As Integer, ByVal iHeight As Integer) bm.Create iWidth, iHeight DrawIntoTheBitmap End Sub Private Sub UserControl_Paint() CopyArea 0,0,bm.Width,bm.Height,bm,0,0 End Sub Private Sub DrawIntoTheBitmap() ... End Sub
Note that initializing the double-buffering bitmap from the Load event handler is now useless, since the Resize event is always sent at least once during the control initialization.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |