MaxWidth Property

FrameworkElement.MaxWidth Property

Gets or sets the maximum width constraint of a FrameworkElement.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public double MaxWidth { get; set; }
<frameworkElement MaxWidth="double"/>

Property Value

Type: System.Double
The maximum width of the object, in pixels. The default is PositiveInfinity. This value can be any value equal to or greater than 0. PositiveInfinity is also valid.

Dependency property identifier field: MaxWidthProperty

This is one of three properties on FrameworkElement that specify width information. The other two are MinWidth and Width. If there is a conflict between these values, the order of application for actual width determination is first MinWidth must be honored, then MaxWidth, and finally if each of these are within bounds, Width.

Non-integral values for MaxWidth are technically permitted, but should generally be avoided and are normally rounded by the default layout rounding behavior. See Layout Rounding.


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2015 Microsoft