How can I mimick a mouse click at an x,y coordinate?

R

Rico

Hello,

I have an issue where I'm using a treeview control. When I right click the
control, I would like a popup menu to appear. The problem is, if I'm not
directly over the text in the treeview, the control doesn't recognize that
anything new is selected.

For example; if the item at the top of the treeview is selected and I want
to select an item 1/2 way down the list, if I right click anywhere on that
line that isn't directly above the text, the selection is not made. the
mouse up event still registers, so the popup menu will appear, but the
control still thinks the first item on the list is selected.

If I could recreate a mouse click at the x,y coordinate, then I would be
able to make sure that this selection is made.

Any ideas?

Thanks!
Rick
 
R

Rico

Never mind, I found a better method (although I'd still be interested to
know about the mouse click).

For those who want to know the solution, I "discovered" the DropHighlight
property in the treeview control. When I right click, I i just run a
"Treeview.DropHighlight.Selected=true" and voila.

Rick
 

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