We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to add tooltips to nodes in a diagram on mouseHover

Hello supportteam,

is there any way to add tooltips to nodes in a diagram on mouseHover-event?
Anything, what I found was for ASP.Net or the links for the samples did not work.
(http://websamples.syncfusion.com/samples/Diagram.Windows/F66125/main.htm)


Many thanks
Michael


2 Replies

AC Aubyn Crawford October 20, 2010 07:38 PM UTC

Since I had some excitment in this area previously... no was the short answer.

You can do it by intercepting the diagram level MouseMove event, looking at the Diagram1.Controller.NodesHit collection. If it hits a node that needs a tooltip you then use the standard windows tooltip component to dispaly the tooltip text you want.



PM Pandi Murugan A Syncfusion Team October 25, 2010 06:07 PM UTC

Hi Hauling,

Thanks for using Syncfusion products.

We suggest you to use the Diagram EventSink's NodeMouseEnter/NodeMouseLeave events and the standard Windows ToolTip to achieve your requirement. Please refer the below code snippet.

[C#]
//Create a Windows ToolTip
System.Windows.Forms.ToolTip toolTip = new System.Windows.Forms.ToolTip();
//Load diagram file
this.diagram1.LoadBinary(@"..\\..\\Enhanced Line Routing.edd");
//NodeMouseLeave and NodeMouseEnter events
this.diagram1.EventSink.NodeMouseEnter += new Syncfusion.Windows.Forms.Diagram.NodeMouseEventHandler(EventSink_NodeMouseEnter); this.diagram1.EventSink.NodeMouseLeave += new Syncfusion.Windows.Forms.Diagram.NodeMouseEventHandler(EventSink_NodeMouseLeave);
void EventSink_NodeMouseLeave(Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs)
{
toolTip.Active = false;
}

void EventSink_NodeMouseEnter(Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs)
{
toolTip.IsBalloon = true;
toolTip.SetToolTip((Control)this.diagram1, evtArgs.Node.Name);
toolTip.Active = true;
}

For your convenience, we have created a simple sample and the same can be downloaded from the below link.

ToolTip808400267.zip

Please let me know if you have any concerns.

Regards,
Pandi Murugan A



Loader.
Live Chat Icon For mobile
Up arrow icon