Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
UltraWinTree - Tooltip issue
posted

Hello,

I am using Infragistics2.Win.UltraWinTree.v9.1.

I am setting tooltips for the tree nodes as below. I am able to display tooltips on mouse hover over the nodes. But when the user moves mouse over the the empty space on the treeview, the tooltips are displayed. How to not to show tooltips over empty space on the treeview?

private void ultraTree1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e)
        {
            if (e.Element is Infragistics.Win.UltraWinTree.NodeTextUIElement)
            {
                // Get the location of the cursor
                Point pt = new Point(e.Element.Rect.X, e.Element.Rect.Y);
                Infragistics.Win.UltraWinTree.UltraTreeNode node = this.ultraTree1.GetNodeFromPoint(pt);

                // If the cursor is on a Tree node
                if (node != null)
                {
                    Infragistics.Win.UltraWinToolTip.UltraToolTipInfo tipInfo = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo(node.Text, Infragistics.Win.ToolTipImage.Default, "", Infragistics.Win.DefaultableBoolean.True);
                    this.ultraToolTipManager1.SetUltraToolTip(this.ultraTree1, tipInfo);
                    this.ultraToolTipManager1.ShowToolTip(this.ultraTree1);
                }
            }
         
        }

 

Thanks,

Naveen

WindowsFormsApplication2.zip
Parents
  • 469350
    Suggested Answer
    Offline posted

    You need to clear the tooltip when the mouse leaves the nodes. So the code you have here only checks for a NodeUIElement, but when you enter any other element, you left the tooltip set to what it was for the last node.

    The check for NodeUIElement seems redundant here, anyway. You are already using GetNodeFromPoint, so you could easily just use that method to get a node. If you get a node, set the Tooltip to what you want, and if you don't get a node, clear the tooltip.

Reply Children
No Data