
Help with API Calls please.........I am at wits end :(
Quote:
> the Right Mouse Click does not shift the Focus
> Rectangle or change the SelectedItem as the Left
> Mouse Button does, meaning I have to LEft-Click
> first then Right-CLick. Please help me with this one.
> I am assuming it is an API call, I might be wrong
> though
I assume you want the right mouse click to act like a left mouse click as
far as selecting an item goes. In VB 3/WIn 3.1 I had a similar job to do
except that I was using a listbox and not a Treeview control. I found
that I could call GetCursorPos and convert to the proper coordinate
system and that would tell me where the mouse had clicked on my form.
Then I found that in a standard VB listbox each item is the same height
as the TextHeight method for the appropriate font. Based on that it
wasn't hard to calculate an offset from the top edge of the listbox and
then add listbox.TopIndex to find which item had been clicked on. The
most tedious part was converting between coordinate systems. Some
functions return values in pixels relative to the upper left corner of
the desktop, some return twips relative to the upper left corner of the
form and you have to figure out of the width of the form's frame is
included in that number, etc.
Good luck
Phil
Save the Earth -- shoot yourself.
URL O' the Day: http://www.vegweb.com