語言

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

屬性值

一個代表矩形寬度(像素單位)的值。 預設值是 0。

例外狀況

指定小於 0 的值。

備註

此結構體代表Windows 執行階段(WinRT)Rect struct的.NET投影。 欲了解更多資訊,請參閱 UWP API 參考中的 Rect 。

欲了解更多資訊及此成員範例,請參閱 .NET Framework API 參考中的 Rect.Width。 (範例顯示 WPF 使用情況,可能無法直接轉換成 UWP XAML。)

適用於