Here's how:

To begin with, let's assume you already have Form1 which has the
menustrip. Make sure
the modifier of your menustrip is set to public. We will construct
Form2 (the child form):

1) Create a New form (the child form)
2) declare a Form1 variable in your child form like:

    private static new Form1 ParentForm = null;

3) define a second constructor, with Form1 as a parameter, like:

        public Form2(Form1 AParent): this()
        {
            ParentForm = AParent;
        }


4) drag a button in your child form.
5) double click your button and type this:

        private void btnEnable_Click(object sender, EventArgs e)
        {
            ParentForm.menuStrip1.Enabled = !
ParentForm.menuStrip1.Enabled;
        }

Now go back to your Form1 class to instantiate Form2. In this example,
put
a button in Form1. Double-click the button in Form1 and add this code:


            Form2 form2 = new Form2(this);
            form2.ShowDialog();


Pass "this" to Form2. "this" refers to the Form1 instance. It allows
you
to access any controls in Form2. Provided that the controls in Form1
have
their modifiers set to public.


Hope this helps.



Benj




On May 3, 9:31 pm, sahm <[email protected]> wrote:
> Hi every one
> How to can I enable or disable Menu Strip in Parent Form from chiliad
> form
> Best
> Salim

Reply via email to