Project Structuring Question *please* help

  • Thread starter Thread starter Patrick De Ridder
  • Start date Start date
P

Patrick De Ridder

I have the following

A solution called SOL001

SOL001 contains a library LIB001
LIB001 contains Form1.cs

SOL001 also contains a windows application APP001
APP001 contains Form2.cs with button1.

How can I call Form1.cs by pressing button1 on Form2.cs? What code
should follow the button1_Click? Or how else should I do this?
 
You'll have to reference LIB001 from APP001. In button1_Click, create an
instance of class Form1 and call Show method.

Thank you! I had done it all, save using the Show() method.

Question:

I can do two things

1. Create a project with Form1 and create Form2 as a control, then
call Form2 from Form1.

2. Create a Library with Form2, then have Form2 called by Form1 in
another project.

The second option has the advantage that Form2, say an I/O form can be
used in different applications, whereas the first option doesn't allow
that. Is my reasoning correct? Is there anything else to be said
additionally about these two options?

(This is the first time I am using Visual Studio .NET so I still have
a lot to learn).

Many thanks.
 
Back
Top