Discussion:
How to get the coordinates (X,Y) of the top/left corner of a Node in a TreeView control
(too old to reply)
Paulo
2016-11-15 12:50:25 UTC
Permalink
Hi All,

I need to display a popup menu in the position of the selected Node of a
TreeView control.
Does anybody know how to get (via API) the exact coordinates (X,Y) of the
top/left corner of a TreeView Node?

TIA,
Paulo
--
Classic VB!
Neila
2016-11-16 00:15:34 UTC
Permalink
Doesn't Treeview have a Hittest method?
---
Post by Paulo
Hi All,
I need to display a popup menu in the position of the selected Node of a
TreeView control.
Does anybody know how to get (via API) the exact coordinates (X,Y) of the
top/left corner of a TreeView Node?
TIA,
Paulo
--
Classic VB!
Paulo
2016-11-16 11:11:54 UTC
Permalink
Post by Neila
Doesn't Treeview have a Hittest method?
The HitTest method returns the reference to a Node object located at given
X,Y coordinates. I could use HiTest to check a grid of points X,Y around the
TreeView control until to find a point inside the bounds of the Node cell.
After a more carefull reading of the MSDN documentation I noticed the
TVM_GETITEMRECT message that seems to respond to my needs. I found this nice
piece of code:
http://stackoverflow.com/questions/6726632/make-the-popupmenu-appear-at-the-selected-item-of-a-treeview-in-vb6

Paulo
--
Classic VB!

Loading...