Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 878687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:48:22+00:00 2026-05-15T11:48:22+00:00

In my application, I have a ToolStripMenu (File, Edit, Notes), a ToolStrip right above

  • 0

In my application, I have a ToolStripMenu (File, Edit, Notes), a ToolStrip right above my work area and a context menu for the work area itself. Now the Notes ToolStripMenu, the ToolStrip and the ContextMenuStrip all have the same content that performs the same actions. I was wondering, is there an elegant way to just design the ToolStripMenu and have the other two “mirror” it’s function and content instead of rewriting everything 3 times? I saw that all 3 controls use ToolStripItems and ToolStripItemCollections and as such I would think this would be quite easy to do, but the properties are mostly read only, and if I try to loop through one’s item to add them to the other, they are removed from the initial owner, and there are no Clone method for ToolStripItems.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:48:23+00:00Added an answer on May 15, 2026 at 11:48 am

    Create a method that re-uses your items, actions, etc…

    public MainForm()
    {
        //in your constructor, create all your common methods, actions, etc and save them to private vars
    
        //Then in your form:
        ToolStripMenu menu = new ToolStripMenu();
        AttachCommonFunctionality(menu);
        Items.Add(menu);
    
        ContextMenuStrip rightClick = new ContextMenuStrip();
        AttachCommonFunctionality(rightClick);
        this.ContextMenu = rightClick;
        //etc...
    }
    
    private void AttachCommonFuntionality(Control c)
    {
        c.Items.Add(_item1);
        c.Items.Add(_item2);
        //etc...
    
        c.OnClick += _myCommonAction;
        //etc...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application have a configuration xml-file. That file contains more than 50 program settings.
I'm starting work with PHPUnit with Kohana. My application have many controllers which simply
So I have an application I am working on at work that we have
I have a web application that requires Blog Forum Chat support etc Now my
My new iPhone application have .ipa file size (by Archive) is 2.8 MB, which
I see an application have used Log.info = some info where are these logs
In my console application have an abstract Factory class Listener which contains code for
I have one question; In my ASP.NET MVC web application have to do certain
I have an game application I have written for Windows Mobile and I want
I have application which needs to use a dll (also written by me) which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.