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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add tooltips to nodes in a diagram on mouseHover

Thread ID:

Created:

Updated:

Platform:

Replies:

97020 Oct 20,2010 03:47 PM UTC Oct 25,2010 06:07 PM UTC Windows Forms 2
loading
Tags: Diagram
hauling
Asked On October 20, 2010 03:47 PM UTC

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


Aubyn Crawford
Replied On 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.


Pandi Murugan A [Syncfusion]
Replied On 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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;