Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement::MaxWidth Property

 

Gets or sets the maximum width constraint of the element.

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

public:
[TypeConverterAttribute((LengthConverter^::typeid))]
[LocalizabilityAttribute(LocalizationCategory::None, Readability = Readability::Unreadable)]
property double MaxWidth {
	double get();
	void set(double value);
}

Property Value

Type: System::Double

The maximum width of the element, in device-independent units (1/96th inch per unit). The default value is PositiveInfinity. This value can be any value equal to or greater than 0.0. PositiveInfinity is also valid.

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.

The value restrictions on the Double value are enforced by a ValidateValueCallback mechanism. If you attempt to set an invalid value, a run-time exception is thrown.

<object MaxWidth="double"/>
- or -
<object MaxWidth="qualifiedDouble"/>

double

Double

String representation of a Double value equal to or greater than 0.0. This is interpreted as a device-independent unit (1/96th inch) measurement. Strings need not explicitly include decimal points. For instance a value of 1 is acceptable.

The same Double range restrictions as mentioned in the Property Value section apply, except that you must use x:Static Markup Extension to set the value to be PositiveInfinity.

qualifiedDouble

A double value as described above, followed by one of the following unit declaration strings: px, in, cm, pt.

px (default) is device-independent units (1/96th inch per unit)

in is inches; 1in==96px

cm is centimeters; 1cm==(96/2.54) px

pt is points; 1pt==(96/72) px

Identifier field

MaxWidthProperty

Metadata properties set to true

AffectsMeasure

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft