Jump to content

Detect where drop occurs between target tree rows (insert location)

Recommended Posts

Does anyone have a solution to detecting where a drop occurred on a target tree control?


I'm already familiar with the 'Point to Row Column' method. However, that only returns the row of the item you mouse is hovering over during the drop.


See, when a user moves his mouse around, a line is shown exactly where the insert will occur. However this line location, between rows, is not available from what i can see. Regardless of where the line is drawn, the 'Point to Row Column' method returns the mouse hover location instead.

  • Like 1
Link to comment
  • 1 month later...

Michael did you ever figure out a solution? I was just trying to figure this out today and found a bunch of threads from a decade ago about this, but haven't found anyone with a solution to the problem. The silly solution I've come up with is to use pt->row on coordinates +/- 5 pixels and if the tag changes then it must be on that border...but I don't like this idea. And this only really works for me because (right now) only one type of element in the tree is allowed to accept children, so I just need to check for that and can either drop or insert based on that property.

Edited by smithd
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.