Dundas Chart for Windows Forms
Position Property
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > Cursor Class : Position Property


Gets or sets the position of a cursor.
Cursor position.

Syntax

Visual Basic (Declaration)  
Public Property Position As Double
Visual Basic (Usage) Copy Code
Dim instance As Cursor
Dim value As Double
 
instance.Position = value
 
value = instance.Position
C#  
public double Position {get; set;}

Return Value

A double value that represents the position of a cursor.

Example

 

C# Copy Code
using Dundas.Charting.WinControl;
...
DateTime myDate = DateTime.Parse(txtXCursorPosition.Text);
chart1.ChartAreas
[0].CursorX.Position = myDate.ToOADate();
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...
Dim myDate As New DateTime()
myDate = myDate.Parse(txtXCursorPosition.Text)
chart1.ChartAreas(0).CursorX.Position = myDate.ToOADate()

Remarks

This property can be used to get the position of a cursor, as well as programmatically set the cursor position.

The position is measured as a value of the axis that the cursor belongs to (that is determined by the AxisType property).  For example, if the cursor belongs to the primary X axis then setting this to a value of January 1, 2000 will result in the X axis cursor being drawn at the January 1, 2000 position along the axis.  If this axis value does not exist then the cursor will not be displayed.

Note that when setting this property the Interval and IntervalOffset properties have no effect (i.e. the cursor will be displayed at the specified location).

Setting this property will not raise the CursorPositionChanged or CursorPositionChanging events. 

Alternatively the SetCursorPosition and SetCursorPixelPosition methods can be used to set the cursor.

To programmatically remove a cursor set the position of the cursor to Double.NaN using this property.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.