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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top