Cursor.Position 屬性

定義

取得或設定資料指標的位置。

public:
 property double Position { double get(); void set(double value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataVisualization.Charting.DoubleDateNanValueConverter))]
public double Position { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataVisualization.Charting.DoubleDateNanValueConverter))>]
member this.Position : double with get, set
Public Property Position As Double

屬性值

游標的位置。

屬性

備註

這個屬性可用來取得資料指標的位置,以及以程式設計方式設定游標位置。

位置會測量為數據指標所屬的座標軸值,由 屬性決定 AxisType 。 例如,如果游標屬於主要 X 軸,則將此屬性設定為 2000 年 1 月 1 日的值,將會導致在 2000 年 1 月 1 日沿著軸的 1 月 1 日位置繪製 X 軸游標。 如果這個座標軸值不存在,將不會顯示游標。

請注意,如果您設定此屬性, IntervalIntervalOffset 屬性將不會有任何作用;也就是說,游標會顯示在此指定的位置。

設定此屬性不會引發 CursorPositionChangedCursorPositionChanging 事件。

或者, SetCursorPositionSetCursorPixelPosition 方法可以用來設定資料指標。

若要以程式設計方式移除資料指標,請使用此屬性將游標的位置設定為 NaN

適用於