CursorEventArgs Class
TOC
Collapse the table of content
Expand the table of content

CursorEventArgs Class

.NET Framework (current version)
 

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

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

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

public class CursorEventArgs : EventArgs

NameDescription
System_CAPS_pubmethodCursorEventArgs(ChartArea, Axis, Double)

Initializes a new instance of the CursorEventArgs class with the specified chart area, axis, and cursor position.

System_CAPS_pubmethodCursorEventArgs(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.

NameDescription
System_CAPS_pubpropertyAxis

Gets the Axis object that a cursor or range selection belongs to.

System_CAPS_pubpropertyChartArea

Gets the ChartArea object that a cursor or range selection belongs to.

System_CAPS_pubpropertyNewPosition

Gets or sets the position of a cursor. Depending on the event, also sets the cursor's position.

System_CAPS_pubpropertyNewSelectionEnd

Gets or sets the end position of a selected range. Depending on the event, also sets the end position of the range.

System_CAPS_pubpropertyNewSelectionStart

Gets or sets the start position of a selected range. Depending on the event, also sets the start position of the range.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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 T:System.Windows.Forms.DataVisualization.Charting.ChartArea.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
Available since 4.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft