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
1375
StatusBar panel AutoStatusText and UltraTree Node
posted

Hi,

I've got a form that contains an UltraTree where I build nodes on the fly. Also on the form is an UltraStatusBar with one panel set to AutoStatusText.

Is there a way to set the StatusBar text so that it displays when the mouse hovers one of the nodes? I apparently can't pass the Node into the SetStatusBarText method because it's the incorrect type.

I tried adding an UltraFormattedLinkLabel as the Nodes label. I was able to call SetStatusBarText and pass in the LinkLabel and text, but the text doesn't display when over the node.

Thanks,

JL

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi JL,

    You can just pass in the tree as the Component parameter to SetStatusBarText. Control derives from Component, so you can use any Control for this. My guess is that the StatusBar only uses the component to tell when the mouse has moved outside of it, so it knows when to clear the message. So in this case, the text will show up when you move over a node and will change if you move over another node, but it won't disppear until the mouse leaves the tree. 

    You could, of course, fix this by blanking it out yourself.


            private void ultraTree1_MouseMove(object sender, MouseEventArgs e)
            {
                UltraTree tree = (UltraTree)sender;
                UltraTreeNode node = tree.GetNodeFromPoint(e.X, e.Y);
                if (node != null)
                    this.ultraStatusBar1.SetStatusBarText(tree, node.Text);
                else
                    this.ultraStatusBar1.SetStatusBarText(tree, null);
            }

     

Reply Children