"Chris" <ch*****@hotmail.com> wrote in message
news:43**************************@posting.google.c om...
"Chris" <ch*****@hotmail.com> wrote in message
news:43**************************@posting.google.c om... I'm able to add a context menu to the right click on a listbox but it
does not select the item in the listbox. I would like the context
menu before it pops up to select the item that the mouse was over when
the right click occurred. Is this possible?
Thanks,
Cristov
"AirPete" <x@x.x> wrote in message
news:<Tq*****************@newsread2.news.pas.earth link.net>... Check out the ListBox's IndexFromPoint function, you can use this to set
the selected item when a right-click occurs.
- Pete
Pete,
Thanks for the info. It worked great with my listbox. Now I'm having
the same problem with a listview though and it doesn't support the
IndexFromPoint method. Any ideas?
Thanks,
Cristov
Cristov,
I just tried a ListView, and it seemed to seelct on rightclick anyway.
Are you manually showing the ContextMenu on the right Click event, or using
the ContextMenu property?
Mine was set to Activation = Standard and ContextMenu = my contextmenu, with
only an ItemActivate event handler.
However, the GetItemAt method is the ListView's equivilent.
- Pete