I use toolTipManager with a TooltipInfo. I have set InitialDelay to both 1000 and 5000 but its just being ignored. The tooltip shows up right away when the mouse hover the element.
The element is a UltraTreeNode.
We are using version 7.2
I corrected the error myself so nevermind :)
jesperlc said:If i assign it to the tree it shows tooltip when i hover the tree. I want it to show the tooltip when i hover a node and it should disappear when the cursor leaves the node...
The idea is that you would set the tooltip when the mouse is over the node and then when the mouse is not over a node, you would clear the tooltip. You could set a different tooltip for each node that way.
Could you please tell me how you have achived using timer, My code as follows
private void UtJobDefinitonWidgetMouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element is NodeTextUIElement) { var point = new Point(e.Element.Rect.X, e.Element.Rect.Y); UltraTreeNode node = utJobDefinitonWidget.GetNodeFromPoint(point); if (node != null) { string nodeText;
if (node.Text == "Scheduler" || (node.Parent != null && node.Parent.Text == "Scheduler")) nodeText = "Scheduling service available jobs."; else nodeText = "Job available for user " + (node.Parent == null ? node.Text : node.Parent.Text);
var tipInfo = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo(nodeText, Infragistics.Win.ToolTipImage.Default, "", Infragistics.Win.DefaultableBoolean.True); ultraToolTipManager1.ShowToolTip(utJobDefinitonWidget); } } else ultraToolTipManager1.HideToolTip(); }
I want to provide delay before displaying the popup as it shows up immediately
Hi,
It's pretty simple. Instead of calling ShowToolTip in the code you have here, you would call the Start method on a Timer object.
In the Timer_Tick event, you call ShowToolTip. That way, the tooltip doesn't shot until the timer ticks. You will also want to stop the timer at that point.
Thank you Mike,
I have implemented in the following manner
private bool _toolTipDispalyed = false ;
private void UtJobDefinitonWidgetMouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element is NodeTextUIElement) { toolTipTimer.Start(); var point = new Point(e.Element.Rect.X, e.Element.Rect.Y); UltraTreeNode node = utJobDefinitonWidget.GetNodeFromPoint(point); if (node != null) { string nodeText;
var tipInfo = new UltraToolTipInfo(nodeText, Infragistics.Win.ToolTipImage.Default, "", Infragistics.Win.DefaultableBoolean.True); ultraToolTipManager1.SetUltraToolTip(utJobDefinitonWidget, tipInfo); } } else ultraToolTipManager1.HideToolTip(); }
private void ToolTipTimerTick(object sender, EventArgs e) { ultraToolTipManager1.ShowToolTip(utJobDefinitonWidget); _toolTipDispalyed = true; toolTipTimer.Stop(); }
private void UtJobDefinitonWidgetMouseLeaveElement(object sender, Infragistics.Win.UIElementEventArgs e) { if(!_toolTipDispalyed) toolTipTimer.Stop(); }
Thank you , it works :-)Do you suggest any changes?
Regards,Roopa
Hi Roopa,
If this is working for you, then I think it's fine.
I would probably start the timer after setting the tooltip, just to be safe.