CursorEventArgs 类

定义

提供与根 Chart 对象中的以下事件一起使用的属性:CursorPositionChangedCursorPositionChangingSelectionRangeChangedSelectionRangeChangingProvides properties that are used with the following events in the root Chart object: CursorPositionChanged, CursorPositionChanging, SelectionRangeChanged and SelectionRangeChanging.

public ref class CursorEventArgs : EventArgs
public class CursorEventArgs : EventArgs
type CursorEventArgs = class
    inherit EventArgs
Public Class CursorEventArgs
Inherits EventArgs
继承
CursorEventArgs

注解

CursorPositionChanged SelectionRangeChanged e 类在CursorPositionChanging根对象的SelectionRangeChanging 、和事件中作为参数公开。 Chart CursorEventArgsThe CursorEventArgs class is exposed as the e parameter in the CursorPositionChanged, CursorPositionChanging, SelectionRangeChanged and SelectionRangeChanging events of the root Chart object.

此类包含以下属性:This class contains the following properties:

  • 属性, 用于ChartArea获取引发事件的对象。 ChartAreaThe ChartArea property, which is used to get the ChartArea object that the event was raised for. Name属性获取图表区的名称; 也可以设置其他图表区属性。The Name property gets the name of the chart area; other chart area properties can also be set.

  • 属性, 用于Axis获取引发事件的对象。 AxisThe Axis property, which is used to get the Axis object that the event was raised for. 若要确定轴 X、X2、Y 或 Y2 的类型, 请使用AxisName属性。To determine the type of axis - X, X2, Y or Y2 - use the AxisName property. 还可以设置其他轴属性。Other axis properties can also be set.

  • NewPosition属性, 它表示光标沿轴的位置, 在引发事件时度量为轴值。The NewPosition property, which represents the position of a cursor along an axis, measured as an axis value, at the time the event was raised. NewPosition属性可用于获取光标的位置。The NewPosition property can be used to get the position of a cursor. 在此CursorPositionChanging事件中, 此属性还可用于重置游标位置。In the CursorPositionChanging event, this property can also be used to reset the cursor position.

  • NewSelectionStart属性, 该属性表示在引发事件时, 沿轴进行的范围选择的开始位置 (以轴值的形式)。The NewSelectionStart property, which represents the starting position of a range selection along an axis, measured as an axis value, at the time the event was raised. NewSelectionStart属性可用于获取选定范围的起始位置。The NewSelectionStart property can be used to get the selected range start position. 在此SelectionRangeChanging事件中, 此属性还可用于重置位置。In the SelectionRangeChanging event, this property can also be used to reset the position.

  • NewSelectionEnd属性, 表示在引发事件时, 在轴上的范围选择的结束位置 (以轴值的形式表示)。The NewSelectionEnd property, which represents the end position of a range selection along an axis, measured as an axis value, at the time the event was raised. NewSelectionEnd属性可用于获取选定范围的结束位置。The NewSelectionEnd property can be used to get the selected range end position. 在此SelectionRangeChanging事件中, 此属性还可用于重置位置。In the SelectionRangeChanging event, this property can also be used to reset the position.

构造函数

CursorEventArgs(ChartArea, Axis, Double)

用指定的图表区域、轴和光标位置初始化 CursorEventArgs 类的新实例。Initializes a new instance of the CursorEventArgs class with the specified chart area, axis, and cursor position.

CursorEventArgs(ChartArea, Axis, Double, Double)

用指定的图表区域、轴以及新范围的起始和结束位置初始化 CursorEventArgs 类的新实例。Initializes a new instance of the CursorEventArgs class with the specified chart area, axis, start and end positions for the new range.

属性

Axis

获取光标或范围选择所属的 Axis 对象。Gets the Axis object that a cursor or range selection belongs to.

ChartArea

获取光标或范围选择所属的 ChartArea 对象。Gets the ChartArea object that a cursor or range selection belongs to.

NewPosition

获取或设置光标位置。Gets or sets the position of a cursor. 还会根据事件设置光标的位置。Depending on the event, also sets the cursor's position.

NewSelectionEnd

获取或设置选定范围的结束位置。Gets or sets the end position of a selected range. 还会根据事件设置该范围的结束位置。Depending on the event, also sets the end position of the range.

NewSelectionStart

获取或设置选定范围的起始位置。Gets or sets the start position of a selected range. 还会根据事件设置该范围的起始位置。Depending on the event, also sets the start position of the range.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于