Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - tree mouse event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

tree mouse event

 Post Reply Post Reply
Author
Message
qodex View Drop Down
Newbie
Newbie
Avatar

Joined: 30 April 2011
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote qodex Quote  Post ReplyReply Direct Link To This Post Topic: tree mouse event
    Posted: 30 April 2011 at 9:19pm
I have a AxXtremeSuiteControls.AxTreeView with a mouse up event. Here''s the handler:


private void treePageDrawerView_MouseUpEvent(object sender, AxXtremeSuiteControls._DTreeViewEvents_MouseUpEvent e)
{
  if (e.button == 2) // right click
  {
    System.Console.WriteLine("Mouse at " + e.x + " " + e.y);
    XtremeSuiteControls.TreeViewNode node = treePageDrawerView.HitTest(e.x*15, e.y*15);
    if (node != null)
    {
      System.Console.WriteLine("Hit " + node.Text);
      Point currentMousePosition = new Point(e.x, e.y);
      pageDrawerPageContextMenuStrip.Show(treePageDrawerView, currentMousePosition);
    }
  }
}



I found this by trial and error, but to determine the tree node that was clicked on, I have to scale (multiply) x and y by 15. That seems to give very accurate results.  Note that this is not a translation problem, that is, shifting x and x relative to say the origin of the tree control doesn't help.  The context menu pops up at exactly the right place.

Am I missing something? Is this some kind of OLE thing? Is there documentation somewhere that explains what''s going on?

Thanks!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.