System.Windows.Forms.PictureBox.SizeMode Property

Indicates how the image is displayed.

Syntax

[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
[System.ComponentModel.Localizable(true)]
[System.ComponentModel.DefaultValue(System.Windows.Forms.PictureBoxSizeMode.Normal)]
public PictureBoxSizeMode SizeMode { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Valid values for this property are taken from the System.Windows.Forms.PictureBoxSizeMode enumeration.

By default, in PictureBoxSizeMode.Normal mode, the System.Drawing.Image is positioned in the upper-left corner of the System.Windows.Forms.PictureBox, and any part of the image that is too big for the System.Windows.Forms.PictureBox is clipped. Using the PictureBoxSizeMode.StretchImage value causes the image to stretch or shrink to fit the System.Windows.Forms.PictureBox. Using the PictureBoxSizeMode.Zoom value causes the image to be stretched or shrunk to fit the System.Windows.Forms.PictureBox; however, the aspect ratio in the original is maintained.

Using the PictureBoxSizeMode.AutoSize value causes the control to resize to always fit the image. Using the PictureBoxSizeMode.CenterImage value causes the image to be centered in the client area.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0