CursorEventArgs Class

Provides properties that are used with the following events in the root Chart object: CursorPositionChanged, CursorPositionChanging, SelectionRangeChanged and SelectionRangeChanging.

System.Object
  System.EventArgs
    System.Windows.Forms.DataVisualization.Charting.CursorEventArgs

Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

'Declaration
Public Class CursorEventArgs _
	Inherits EventArgs

The CursorEventArgs type exposes the following members.

  NameDescription
Public methodCursorEventArgs(ChartArea, Axis, Double)Initializes a new instance of the CursorEventArgs class with the specified chart area, axis, and cursor position.
Public methodCursorEventArgs(ChartArea, Axis, Double, Double)Initializes a new instance of the CursorEventArgs class with the specified chart area, axis, start and end positions for the new range.
Top

  NameDescription
Public propertyAxisGets the Axis object that a cursor or range selection belongs to.
Public propertyChartAreaGets the ChartArea object that a cursor or range selection belongs to.
Public propertyNewPositionGets or sets the position of a cursor. Depending on the event, also sets the cursor's position.
Public propertyNewSelectionEndGets or sets the end position of a selected range. Depending on the event, also sets the end position of the range.
Public propertyNewSelectionStartGets or sets the start position of a selected range. Depending on the event, also sets the start position of the range.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The 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:

  • The ChartArea property, which is used to get the ChartArea object that the event was raised for. The Name property gets the name of the chart area; other chart area properties can also be set.

  • The Axis property, which is used to get the Axis object that the event was raised for. To determine the type of axis—X, X2, Y or Y2—use the AxisName property. Other axis properties can also be set.

  • 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. The NewPosition property can be used to get the position of a cursor. In the CursorPositionChanging event, this property can also be used to reset the cursor position.

  • 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. The NewSelectionStart property can be used to get the selected range start position. In the SelectionRangeChanging event, this property can also be used to reset the position.

  • 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. The NewSelectionEnd property can be used to get the selected range end position. In the SelectionRangeChanging event, this property can also be used to reset the position.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft