Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is it possible to carry a menustrip from one form to the next?

My project has a very extensive menustrip, and i prefer not to copy all the code for each form.

Is there an easy possibility to this? Or, is it possible at all?
Posted
Comments
Sandeep Mewara 23-Mar-11 10:47am    
Not very clear but sounds like making menustrip a usercontrol should do. What say?

1 solution

Yes. You can create the menu strip in code (put it in a static global class), and then add it to each form (probably in the form's constructor).

At that point, all you have to do is add event handlers for the menu items.

You can also create a base form class that contains the menustrip, and then derive new forms from that new base class. At that point, you don't have to add event handlers in each form if you're clever about your coding.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Mar-11 19:22pm    
This is correct. My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900