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
710
capture lost focus on an tree element
posted

Things behind:

I've an unbound tree. I have to mark an element after user press the right mouse key and display a context-menu. Somthing like in outlook after
you press the right-mouse the element is marked with a slight-border.
After mark another element regulary with the left mouse key the before slightly marked element lost the mark.
The point is: The user sould see what element he has hit with right mouse

Parents
  • 69832
    Offline posted

    I assume you are referring to selecting nodes on a right-click; UltraTree does not do this through the user interface, but you can programmatically select a node on a right-click, as demonstrated by the following code sample:

    private void ultraTree1_MouseDown(object sender, MouseEventArgs e)
    {

        UltraTree treeControl = sender as UltraTree;

        if ( e.Button == MouseButtons.Right )
        {
            UltraTreeNode nodeAtPoint = treeControl.GetNodeFromPoint( e.Location );

            if ( nodeAtPoint != null )
                this.SelectNode( nodeAtPoint, true );
        }

    }

    private void SelectNode( UltraTreeNode node, bool activate )
    {
        UltraTree treeControl = node.Control;
        if ( treeControl != null )
        {
            if ( activate )
                node.Control.ActiveNode = node;

            node.Selected = true;
        }
    }

Reply Children
No Data