Home Forums WinForms controls Other WinForms controls How to catch event MouseRightClick on Xceed TreeView

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17972 |

    Hi all!

    anybody can help me! I want catch event MouseRightClick on Xceed TreeView and get the Key’s Node click

    Thanks

    Imported from legacy forums. Posted by khanhnd (had 2079 views)

    User (Old forums)
    Member
    Post count: 23064

    You’ll need to wire up the TreeView’s MouseUp event, trap for the correct MouseButton press, then use the TreeView’s GetItemAtPoint method to find your selected Node.


    treeView.MouseUp += new System.Windows.Forms.MouseEventHandler(treeView_MouseUp);

    private void treeView_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    // test for right mouse button click
    if (e.Button == MouseButtons.Right)
    {
    Point pt = new Point(e.X, e.Y); // click coordinates
    Node selectedNode = treeView.GetItemAtPoint(pt) as Node;

    }
    }

    Hope this helps!

    Imported from legacy forums. Posted by Christopher (had 3124 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.