Sets new cursor position.
Visual Basic (Declaration) | |
---|---|
Public Sub SetCursorPixelPosition( _ ByVal coord As PointF, _ ByVal roundToBoundary As Boolean _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void SetCursorPixelPosition( PointF coord, bool roundToBoundary ) |
Parameters
- coord
- A PointF structure that determines the point where the cursor will be drawn.
New cursor position as pixel coordinates. - roundToBoundary
- If true then the cursor will be drawn along the nearest chart area boundary if the specified position does not fall within a ChartArea object.
Indicates that coordinates must be rounded to area plotting boundary.
C# | Copy Code |
---|---|
using Dundas.Charting.WinControl; |
Visual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WinControl |
This method displays a cursor at the specified location, and is measured in pixels. Note that the point 0,0 is the top-left corner of the entire chart image, and NOT the relevant chart area.
If the roundToBoundary parameter is FALSE then the cursor will not be drawn if the specified coordinate is located outside of a chart area. However, if roundToBoundary is TRUE then the cursor will be drawn along the nearest chart area boundary if the point is not inside a chart area.
When using this method for the horizontal cursor the Point.X parameter value affects whether or not the cursor is actually drawn, depending on whether the point occurs within a chart area as well as the roundToBoundary parameter setting. The PointF.Y parameter is used for the pixel value where the cursor will be drawn. The same situation holds true for the vertical cursor, but vice-versa.
SetCursorPixelPosition can be very useful if a cursor position is being set inside some sort of event caused by user-interaction. For example, if the Mouse_Down event is being used to implement cursors when the middle mouse button is clicked SetCursorPixelPosition can be used to set the cursor position. The X and Y coordinates of the mouse click can be obtained from the event arguments, and like this method will use pixels, with a 0,0 coordinate at the top-left corner of the chart image.
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