Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listbox item select / popup menu : using right click

Status
Not open for further replies.

IRslow

Technical User
Nov 6, 2000
4
US
Help!! I am displaying a file directory in a listbox
and when I right_click on a file in the list, the popup
menu is displayed but, the file that I "right clicked" on,
is not SELECTED and any menu option, runs on the last file
that was SELECTED (using the Left_button click). Can
anybody help de-mystify this problem for me ? Thanks in
advance. IrSlow:Larry
 
I'm not an expert, but I think you need to perform a HitTest(x,y) on your listview (Windows Common controls library sp(5)) in order to determine where you're clicking. Then set the selecteditem property of the listview = to the listitem returned by the HitTest. Use the MouseUp event for the list since its parameters include the coordinates (x,y) that were clicked.
 
Hey Freedom319,

Thank you for that info. I will experiment with
it, using what you passed on to me. Many thanks. Irslow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top