Print Page | Close Window

tree mouse event

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=18295
Printed Date: 10 May 2024 at 1:53am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: tree mouse event
Posted By: qodex
Subject: tree mouse event
Date 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!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net