共用方式為


Slider.TickPlacement 屬性

定義

取得或設定依據 TrackSlider 的刻度標記位置。

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

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 值,才會顯示刻度標記。

適用於

另請參閱