CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    49

    I can't create instances of my new form in C# winforms... any idea why?

    When I use the following code...

    Form1 frmTest = new Form1();

    I get a new instance of Form1...

    I have added a form called Form2 to the project, but when I use the following code...

    Form2 frmTest1 = new Form2();

    I get the following error :


    The type or namespace name 'Form2' could not be found (are you missing a using directive or an assembly reference?)

    its definitely called Form2, and I have even tried this with other forms, like Form3 etc, but all I can do is Form1... any help?

    Thanks in advance.

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: I can't create instances of my new form in C# winforms... any idea why?

    What is the namespace in the Form1.cs file? What is the namespace in the Form2.cs file?
    ===============================
    My Blog

  3. #3
    Join Date
    Sep 2008
    Posts
    49

    Re: I can't create instances of my new form in C# winforms... any idea why?

    Thankyou eclipsed4utoo there was a mismatch, I haven't used this forum in a while, is there a rating system I should use to thank you?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured