show a pre-created form

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

I have two forms (in the "application", in the "solution"):
neither is dynamically created.

1. how do I reference the second form from the first ?

because
form2.showDialog();

gets the error:
"C:\Documents and Settings\tom\My Documents\Visual Studio
Projects\WindowsApplication2\WindowsApplication2\Form1.cs(201): The type or
namespace name 'form2' could not be found (are you missing a using directive
or an assembly reference?)"

thanks
tom
 
tom said:
neither is dynamically created.

Both are dynamically instanciated, although this is
done automatically for you for the Startup Form.
form2.showDialog();

Try

form2 f = new form2();
f.ShowDialog();

furthermore, the name of your Form class might be "Form2", not "form2".
 
Back
Top