Communication between forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have two forms a MainForm which is the entry point of my application and I created a 'Settings..' dialog box which appears when I click on my itemmenu 'Setting'.

I had no problem to get the results from the 'setting' form into my MainForm when I use :
if (SettingForm.ShowDialog() == DialogResult.OK)
{
//I process the results
}

But I want my results to be handled by the MainForm without the SettingForm disappearing. Just like if I had an 'Apply' button. With this feature I could change several time my settings and directly observe the effect in the MainForm.

May you help me please.
 
Stéphane Roucheray said:
Hi all,

I have two forms a MainForm which is the entry point of my application and
I created a 'Settings..' dialog box which appears when I click on my
itemmenu 'Setting'.
I had no problem to get the results from the 'setting' form into my MainForm when I use :
if (SettingForm.ShowDialog() == DialogResult.OK)
{
//I process the results
}

But I want my results to be handled by the MainForm without the
SettingForm disappearing. Just like if I had an 'Apply' button. With this
feature I could change several time my settings and directly observe the
effect in the MainForm.
May you help me please.

You could have your "Apply" button fire an event that the main form could
subscribe to.
 
Back
Top