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

1public override Cursor GetCursor(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, Point point)
2{
3 switch (DrawingState)
4 {
5 //when drawing, display the cursor as a pen
6 case DrawingState.Building: return Cursors.Pen;
7
8 // when moving, display a four-headed sizing cursor
9 case DrawingState.Moving: return Cursors.SizeAll;
10
11 default: return Cursors.Pen;
12 }
13}