SizeMode Property
Applies To
PictureBox
Description
Indicates how the image is displayed.
Usage
GGet Form.Control.SizeMode, var
GSet Form.Control.SizeMode, value
- Form
- Name of a form or string variable containing a form name.
- Control
- Name of a control or string variable containing a control name. The control must exist in the specified form.
- var
- Integer variable that will contain the value of the property.
- value
- Integer expression for the new value of the property.
Values
0 - Normal
1 - StretchImage
2 - AutoSize
3 - CenterImage
4 - Zoom
Default: Normal
Remarks
By default, in Normal mode, the image is placed in the upper left corner of the PictureBox, and any part of the image too big for the PictureBox is clipped.
Using the StretchImage value causes the image to stretch to fit the PictureBox.
Using the AutoSize value causes the control to resize to always fit the image.
Using the CenterImage value causes the image to be centered in the PictureBox.
Using the Zoom value causes the image to stretch to fit the PictureBox keeping the same aspect ratio.
See Also
PictureBox, Image, ImageAlign
Example
GSet frmMain.picLogo.SizeMode, SIZEMODE_AUTOSIZE