Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to change the mouse cursor to "Hand" if the mouse is over link's end? (Read 2122 times)
Homam
Junior Member
**
Offline


I Love MindFusion!

Posts: 67
Joined: Feb 7th, 2012
How to change the mouse cursor to "Hand" if the mouse is over link's end?
Sep 29th, 2012 at 12:46pm
Print Post  
How to change the mouse cursor to "Hand" if the mouse is over link's end or start?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to change the mouse cursor to "Hand" if the mouse is over link's end?
Reply #1 - Sep 30th, 2012 at 6:15am
Print Post  
You could set DiagramView.MoveCursor to Cursors.Hand, but it will also appear for other control points. If you need to show it only for the first and last points, set the OverrideCursor property when you detect the mouse if over the respective handles:

Code
Select All
private void diagramView_MouseMove(object sender, MouseEventArgs e)
{
	PointF mousePos = diagramView.ClientToDoc(e.Location);
	DiagramLink link = diagram.GetLinkAt(mousePos, 3);
	if (link != null && link.Selected && (
		Utilities.Distance(link.StartPoint, mousePos) <= diagram.AdjustmentHandlesSize ||
		Utilities.Distance(link.EndPoint, mousePos) <= diagram.AdjustmentHandlesSize))
	{
		diagramView.OverrideCursor = Cursors.Hand;
	}
	else
	{
		diagramView.OverrideCursor = null;
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Homam
Junior Member
**
Offline


I Love MindFusion!

Posts: 67
Joined: Feb 7th, 2012
Re: How to change the mouse cursor to "Hand" if the mouse is over link's end?
Reply #2 - Sep 30th, 2012 at 1:36pm
Print Post  
It worked well. Thank you.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint