In a Windows Forms application, there is one form that is the main form of
the thread. Other forms are launched from this one. So, you need to declare
the other forms in the main form, but do NOT make them static. Then you can
reference the other forms and their data from the main form.

Signature
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
> Hello, friends,
>
[quoted text clipped - 20 lines]
>
> What is the best approach for this? Any reference papers? Thanks a lot.
Andrew - 29 Mar 2007 21:12 GMT
Thanks, Kevin.
If that is the case, I need to declare each opened form at Main form scope,
not in its method scope, right?
I saw sample source code like the follows, and once this form is
instantiated, it can no longer be referenced:
private void mainToolStripMenuItem_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
frmWindow1 frm1= new frmWindow1 ();
frm1.Show();
Cursor = Cursors.Default;
}
)
Do you know any links to good reference papers on this? Thanks.
> In a Windows Forms application, there is one form that is the main form of
> the thread. Other forms are launched from this one. So, you need to declare
> the other forms in the main form, but do NOT make them static. Then you can
> reference the other forms and their data from the main form.
Kevin Spencer - 30 Mar 2007 13:34 GMT
Remember that a Form is just another Control class. So, as long as your code
makes sure to clean it up (dispose) properly, it doesn't matter what scope
you declare it at. Here's a good reference for you:
http://www.syncfusion.com/faq/windowsforms/Default.aspx

Signature
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
> Thanks, Kevin.
>
[quoted text clipped - 28 lines]
>> can
>> reference the other forms and their data from the main form.