I’m trying to sho a contextmenu on right-click on an item in a listbox. So i’m binding a list of “Users” to my listbox. Then i’m a bit lost. I thought i could foreach the list and add a mouserightdown event on the listboxitems, but i can’t figure out how.
Is this a good way, or does anyone know a better way of accomplishing what i want.
Thanks in advance.
You can do 2 things that may solve the problem you are experiencing :
1) If you use usercontrols to fill your listbox, you can add click events to it.
2) If you add a contextmenu to your listbox, right-clicking an item will automatically open the contextmenu, so you don’t have to add a click event to it.