RangeBase.Maximum 屬性

定義

取得或設定範圍項目的最高可能 Value

public:
 property double Maximum { double get(); void set(double value); };
[System.ComponentModel.Bindable(true)]
public double Maximum { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.Maximum : double with get, set
Public Property Maximum As Double

屬性值

範圍項目的最高可能 Value。 預設值是 1。

屬性

範例

RangeBase 控制項,例如 SliderProgressBar 繼承 RangeBase 屬性。 下列範例顯示 Slider 使用 屬性的 Maximum

Slider hslider = new Slider();
hslider.Width = 100;
hslider.Orientation = Orientation.Horizontal;
hslider.IsSnapToTickEnabled = true;
hslider.Minimum = 1;
hslider.Maximum = 20;
hslider.TickPlacement = TickPlacement.Both;
hslider.TickFrequency = 2;
hslider.AutoToolTipPlacement =
  AutoToolTipPlacement.BottomRight;
cv1.Children.Add(hslider);
Dim hslider As New Slider()
hslider.Width = 100
hslider.Orientation = Orientation.Horizontal
hslider.IsSnapToTickEnabled = True
hslider.Minimum = 1
hslider.Maximum = 20
hslider.TickPlacement = TickPlacement.Both
hslider.TickFrequency = 2
hslider.AutoToolTipPlacement = AutoToolTipPlacement.BottomRight
cv1.Children.Add(hslider)
<Slider Name="slider1" 
        Width="100" 
        Orientation="Horizontal" HorizontalAlignment="Left" 
        IsSnapToTickEnabled="True" Minimum="1" Maximum="20" 
        TickPlacement="Both"  TickFrequency="2"
        AutoToolTipPlacement="BottomRight"/>

備註

Slider 會覆寫此屬性的中繼資料,並將其預設值設定為 10。 ProgressBar 會覆寫此屬性的中繼資料,並將其預設值設定為 100。 如需詳細資訊,請參閱相依性屬性概觀

相依性屬性資訊

識別碼欄位 MaximumProperty
設定為 的中繼資料屬性 true

適用於