Jump to content
Software FX Community

Detecting MouseMove event


User (Legacy)

Recommended Posts

Hello,

My desired objective is to have the mouse cursor change to a wait cursor

when the mouse is over an Axis, a Point, or the LegendBox. The below code

tries to accomplish this and does so except for the LegendBox. In fact,

HitType.LegendBox is never returned when the mouse moves over the LegendBox.

Is this a known issue? Is there a work around? Am I doing something wrong?

Thanks in advance,

Bob Williams

mailto:bwilliams@meridium.com

private void chartFX_MouseMove(object sender,

SoftwareFX.ChartFX.MouseEventArgsX e)

{

bool bHand = false;

int series, point;

object obj;

switch( chartFX.HitTest(e.X, e.Y, out series, out point, out obj) )

{

case HitType.Axis:

case HitType.Point :

case HitType.LegendBox :

bHand = true;

e.Handled = true;

break;

}

this.Cursor = (bHand) ? Cursors.Hand : Cursors.Default;

}

Link to comment
Share on other sites

The MouseMove event is only fired for the chart area. It is not fired for

Legend Boxes, Data Editor or Toolbar.

The HitTest Method also, works only with coordinates within the chart area.

Trapping mouse movement outside of the chart area is simply not supported.

A workaround could be to capture the mouse in your form (Capture = true) and

determine whether the mouse is over the chart or one of its children using

GetChildAtPoint (Control). I've never done this but sounds like it should be

possible.

PS: Please use the chartfx.net newsgroups for postings relating to Chart FX

for .NET. This newsgroup is for Chart FX COM.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...