Visual Basic Reference
SizeMode Property
See Also Example Applies To
Returns or sets a value specifying how the OLE container control is sized or how its image is displayed when it contains an object.
Syntax
object**.SizeMode** [ **=**value]
The SizeMode property syntax has these parts:
Part | Description |
Object | An object expression that evaluates to an object in the Applies To list. |
Value | An integer or constant specifying how the control is sized or how its image is displayed, as described in Settings. |
Settings
The settings for value are:
Constant | Value | Description |
VbOLESizeClip | 0 | (Default) Clip. The object is displayed in actual size. If the object is larger than the OLE container control, its image is clipped by the control's borders. |
VbOLESizeStretch | 1 | Stretch. The object's image is sized to fill the OLE container control. The image may not maintain the original proportions of the object. |
VbOLESizeAutoSize | 2 | Autosize. The OLE container control is resized to display the entire object. |
VbOLESizeZoom | 3 | Zoom. The object is resized to fill the OLE container control as much as possible while still maintaining the original proportions of the object. |
Remarks
When SizeMode is set to 2 (Autosize), the OLE container control is automatically resized when the display size of an object changes. When this occurs, the Resize event is invoked before the OLE container control is automatically resized. The heightnew and widthnew arguments in the Resize event procedure indicate the optimal size for displaying the object (this size is determined by the application that created the object). You can size the control by changing the values of the heightnew and widthnew arguments in the Resize event procedure.