link one form's controls to modify the main form

How do you link one form (say an OptionsDialog) to modify the Main Form

i.e. Choose options in the OptionsDialog and make them modify the Main Form

Like a settings dialog...




Answer this question

link one form's controls to modify the main form

  • Gizmoguy

    you create separate form and call it. then check it's settings and modify main form accordingly

    using(SettingsForm frm = new SettingsForm())
    {

    if(frm.ShowDialog() == DialogResult.OK)
    {

    //change title for instance
    this.Text = frm.MainFormTitle;
    //etc....

    }
    }

    hope this helps



  • Jean-Jean

    Alternatively, run a loop on the main form that checks a buffer for instructions.
  • namnguyen

    Thank You, that worked.

  • g.ursula

    Create a delegate on the options form and in your main form, hook it to a method on the main form. Then you can call your method in the options dialog and it will call the method in the main form, by calling the delegate.



  • link one form's controls to modify the main form