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


coordStart
A PointF structure that determines the point where the range selection begins.  The PointF.Y value is used for the horizontal cursor, and the PointF.X value is used for the vertical cursor.
New selection start pixel coordinates.
coordEnd
A PointF structure that determines the point where the range selection ends.  The PointF.Y value is used for the horizontal cursor, and the PointF.X value is used for the vertical cursor.
New selection end pixel coordinates.
roundToBoundary
If TRUE then the starting or ending range selection position will be drawn along the nearest chart area boundary if the specified position does not fall within a ChartArea object.  If FALSE the range selection will not be drawn if either the starting or ending position falls outside of the chart area.
Indicates that coordinates must be rounded to area plotting boundary.

This method sets the starting and ending positions of a range selection.


Sets new range selection start and\or end position.

Syntax

Visual Basic (Declaration)  
Public Sub SetSelectionPixelPosition( _
   ByVal coordStart As PointF, _
   ByVal coordEnd As PointF, _
   ByVal roundToBoundary As Boolean _
) 
Visual Basic (Usage) Copy Code
Dim instance As Cursor
Dim coordStart As PointF
Dim coordEnd As PointF
Dim roundToBoundary As Boolean
 
instance.SetSelectionPixelPosition(coordStart, coordEnd, roundToBoundary)
C#  
public void SetSelectionPixelPosition( 
   PointF coordStart,
   PointF coordEnd,
   bool roundToBoundary
)

Parameters

coordStart
A PointF structure that determines the point where the range selection begins.  The PointF.Y value is used for the horizontal cursor, and the PointF.X value is used for the vertical cursor.
New selection start pixel coordinates.
coordEnd
A PointF structure that determines the point where the range selection ends.  The PointF.Y value is used for the horizontal cursor, and the PointF.X value is used for the vertical cursor.
New selection end pixel coordinates.
roundToBoundary
If TRUE then the starting or ending range selection position will be drawn along the nearest chart area boundary if the specified position does not fall within a ChartArea object.  If FALSE the range selection will not be drawn if either the starting or ending position falls outside of the chart area.
Indicates that coordinates must be rounded to area plotting boundary.

Remarks

This method displays a range selection at the specified starting and ending 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.

A special value of PointF.Empty for the coordEnd and coordStart parameters will result in the previous position being used. 

When using this method for the horizontal cursor the PointF.X parameter value does not have any effect, since it is the PointF.Y value that determines the starting or ending position of the range selection.  The same situation holds true for the vertical cursor, but vice-versa.

Note that SetSelectionPixelPosition can be very useful if a range selection is being set inside some sort of event(s) caused by user-interaction.  For example, if the Mouse_Move event is being used to implement a range selection when the middle mouse button is used SetCursorPixelPosition can be used to set the range selection.  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.

Note that the interval-related properties have no effect when setting a range selection using this method.

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.