Edit

Share via


SizeToContent Enum

Definition

Specifies how a window will automatically size itself to fit the size of its content. Used by the SizeToContent property.

C#
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public enum SizeToContent
Inheritance
SizeToContent
Attributes

Fields

Name Value Description
Manual 0

Specifies that a window will not automatically set its size to fit the size of its content. Instead, the size of a window is determined by other properties, including Width, Height, MaxWidth, MaxHeight, MinWidth, and MinHeight. See WPF Windows Overview.

Width 1

Specifies that a window will automatically set its width to fit the width of its content, but not the height.

Height 2

Specifies that a window will automatically set its height to fit the height of its content, but not the width.

WidthAndHeight 3

Specifies that a window will automatically set both its width and height to fit the width and height of its content.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9