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

  • Thread starter Thread starter Rico
  • Start date Start date
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
 
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
 
Back
Top