So I have a group of controls, all created dynamically and added to a panel. On creation I set each of thier context menu properies to a context menu I have created. I want the user to be able to right click each control, and select "Disable Cotrol" from the menu, at which point the control will be removed from the control collection of the panel.
I assumed incorectly that the "sender" parameter of the MenuItem_Click event was the control that was clicked, however this is not the case, it's the menuitem itself... so how do I determine what control is being clicked? Do i have to set an index in the mousedown even or something?
any help appreciated.
I assumed incorectly that the "sender" parameter of the MenuItem_Click event was the control that was clicked, however this is not the case, it's the menuitem itself... so how do I determine what control is being clicked? Do i have to set an index in the mousedown even or something?
any help appreciated.