Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #2290 > unrolled thread

How to get the coordinates (X,Y) of the top/left corner of a Node in a TreeView control

Started by"Paulo" <nospam.vbstudent@syscolor.net>
First post2016-11-15 12:50 +0000
Last post2016-11-16 11:11 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.basic.visual.misc


Contents

  How to get the coordinates (X,Y)  of the top/left corner of a Node in a TreeView control "Paulo" <nospam.vbstudent@syscolor.net> - 2016-11-15 12:50 +0000
    Re: How to get the coordinates (X,Y)  of the top/left corner of a Node in a TreeView control Neila <david.marso@gmail.com> - 2016-11-15 16:15 -0800
      Re: How to get the coordinates (X,Y)  of the top/left corner of a Node in a TreeView control "Paulo" <nospam.vbstudent@syscolor.net> - 2016-11-16 11:11 +0000

#2290 — How to get the coordinates (X,Y) of the top/left corner of a Node in a TreeView control

From"Paulo" <nospam.vbstudent@syscolor.net>
Date2016-11-15 12:50 +0000
SubjectHow to get the coordinates (X,Y) of the top/left corner of a Node in a TreeView control
Message-ID<o0f04a$fr0$1@dont-email.me>
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! 

[toc] | [next] | [standalone]


#2291

FromNeila <david.marso@gmail.com>
Date2016-11-15 16:15 -0800
Message-ID<2a4d4188-5170-4a5a-be7e-de2526fdee90@googlegroups.com>
In reply to#2290
Doesn't Treeview have a Hittest method?
---
On Tuesday, November 15, 2016 at 7:47:40 AM UTC-5, Paulo wrote:
> 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!

[toc] | [prev] | [next] | [standalone]


#2292

From"Paulo" <nospam.vbstudent@syscolor.net>
Date2016-11-16 11:11 +0000
Message-ID<o0heod$im2$1@dont-email.me>
In reply to#2291
"Neila" <david.marso@gmail.com> wrote:
> 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!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.basic.visual.misc


csiph-web