C# WinForms: I need to update the text on a ContextMenuStrip

Posted on 2012-09-16
Last Modified: 2012-09-16
I created a ContextMenuStrip but need to update the item text in code.  I have no problem assigning the next text to the Text property.  The problem I have is getting a handle to the particular menu item.

Can I do this from the ContextMenuStrip to which the item belongs?

How do I do this?

Question by:newbieweb
    LVL 74

    Accepted Solution

    How are you attempting to get the item? Each item in a CMS is itself an object, so you should just be able to use its name.


    using System;
    using System.Windows.Forms;
    namespace WindowsFormsApplication1
        public partial class Form1 : Form
            public Form1()
            private void button1_Click(object sender, EventArgs e)
                this.helloWorldToolStripMenuItem.Text = "Goodbye World!";

    Open in new window

    Before and After

    Author Closing Comment


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now