Slider.TickPlacement 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
public:
property System::Windows::Controls::Primitives::TickPlacement TickPlacement { System::Windows::Controls::Primitives::TickPlacement get(); void set(System::Windows::Controls::Primitives::TickPlacement value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.Primitives.TickPlacement TickPlacement { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.TickPlacement : System.Windows.Controls.Primitives.TickPlacement with get, set
Public Property TickPlacement As TickPlacement
屬性值
TickPlacement 值,定義如何依據滑動軸在 Slider 中定位刻度標記。 預設為 None。
- 屬性
範例
下列範例會示範如何設定 TickPlacement 屬性。
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"/>
備註
屬性 TickPlacement 必須設定為 以外的 None 值,才會顯示刻度標記。