views:

158

answers:

1

Hi,

I want to open one form from another. I'm having no troubles doing this with blank project. Start new, make 2 forms, put button on first, use this code

Form2 ^ form = gcnew Form2;
form->ShowDialog();

Also adding the include file at the top...

I'm getting this error

error c3767 candidate function(s) not accessible

I've gone through my project and compared it to the really basic one I tried as an example...I've been searching google for hours and trying all sorts of different things, but none of the other peoples problems are related to opening another form...

If anyone could shed any light on this for me, it would be awesome

Thanks

Simon

+1  A: 

It looks like the form's constructor is not public. This example form generates that exact same error message:

    public ref class Form2 : public System::Windows::Forms::Form
    {
    //public:     // <=== Remove this comment to fix C3767
       Form2(void)
       {
         InitializeComponent();
       }
       // etc...
    };
Hans Passant