Using a Treview Control on UserForm

V

VKY

Hi everyone,

I have placed a treeview control on a userform (in VBA) and is trying to
implement an OLE drag and drop. On the mousemove event, I am using
TreeView1.HitTest method to detect which element the user has dragged.

The problem is that the x and y coordinates returned are in
OLE_XPOS_PIXELS. The HitTest event failed to return the proper element
unless I multiply the x/y coordinates by 15 which is the
Screen.TwipsPerPixelX property.

However, in VBA there is no Screen object and this constant may differ
from 15 when on another user with a different screen settings. Any
pointers into how I can convert the x/y values?

VKY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top