GetCursor()

View as Markdown

Definition

An event driven method which is called when a chart object is selected. This method can be used to change the cursor image used in various states.

Method Return Value

This method returns a Cursor used to paint the mouse pointer.

Syntax

You must override the method in your Drawing Tool with the following syntax:

public override Cursor GetCursor(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, Point point)

Method Parameters

ParameterDescription
chartControlA ChartControl representing the x-axis
chartPanelA ChartPanel representing the panel for the chart
chartScaleA ChartScale representing the y-axis
pointA Point in device pixels representing the current mouse cursor position

Examples

public override Cursor GetCursor(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, Point point)
{
switch (DrawingState)
{
//when drawing, display the cursor as a pen
case DrawingState.Building: return Cursors.Pen;
// when moving, display a four-headed sizing cursor
case DrawingState.Moving: return Cursors.SizeAll;
default: return Cursors.Pen;
}
}