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".
 
Form f = new Form2();

f.ShowDialog();



many thanks

above is what did it in the end

tom
 

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