RangeBase.Maximum 属性

定义

获取或设置范围元素的最大可能的 ValueGets or sets the highest possible Value of the range element.

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

属性值

范围元素的最大可能的 ValueThe highest possible Value of the range element. 默认值为 1。The default is 1.

属性

示例

RangeBase 控件,如 SliderProgressBar 继承 RangeBase 属性。RangeBase controls such as Slider and ProgressBar inherit the RangeBase properties. 下面的示例演示使用 Maximum 属性的 SliderThe following example shows a Slider that uses the Maximum property.

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。Slider overrides the metadata of this property and sets its default to 10. ProgressBar 重写此属性的元数据,并将其默认设置为100。ProgressBar overrides the metadata of this property and sets its default to 100. 有关详细信息,请参阅依赖项属性概述For more information, see Dependency Properties Overview.

依赖项属性信息Dependency Property Information

标识符字段Identifier field MaximumProperty
元数据属性设置为 trueMetadata properties set to true NoneNone

适用于