Question

I have made a custom control which consists of a richtextbox and a picture box. Now i want to include a contextmenustrip on the richtextbox actually. But the code which i want to call on click of the different menus on the menustrip belongs to the Main project in which i'l be adding this control. So i thought of adding the contextmenustrip to the usercontrol in the project. But now problem is if i right click on the picture box i get the menu strip but when i rightclick on the richtextbox i don't get contextmenustrip, any reasons or suggestions?

Also strangely any event which i write for handling the usercontrol in my project it doesn't at all fire. Is it because i've put it inside a panel control? Any help?

Was it helpful?

Solution

Add the context menu to the rich text box, as you did initially. Now, instead of executing the code, raise an event when then menu item is clicked.

Handle this new event in the main project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top