Rect.Width 属性

定义

获取或设置矩形的宽度。

public:
 property double Width { double get(); void set(double value); };
public double Width { get; set; }
member this.Width : double with get, set
Public Property Width As Double

属性值

Double

一个值,该值表示矩形的宽度(以像素为单位)。 默认值为 0。

例外

指定小于 0 的值。

注解

此结构表示 Windows 运行时 (WinRT) 结构的 .NET 投影 Rect 。 有关详细信息,请参阅 UWP API 参考中的 Rect

有关此成员的详细信息和示例,请参阅 Rect.Width .NET FRAMEWORK API 参考中的。 (示例演示 WPF 用法,可能无法直接转换为 UWP XAML。 )

适用于