Jump to content
Software FX Community

Detecting MouseMove event


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...