0

I have a project that consist of 2 Forms. I am trying to open Form2 with this code but when I compile the project I have this compile error and wonder what this meens and why it doesn´t work.

cannot convert from 'System::Windows::Forms::Form ^' to 'Form1::Form2 ^

1> No user-defined-conversion operator available, or
1> Cast from base to derived requires safe_cast or static_cast

#include "Form2.h"


Form2^ newform2 = gcnew Form;
newform2->ShowDialog();
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Lukezzz
0

Try this:

#include "Form2.h"


Form2^ newform2 = gcnew Form2;
newform2->ShowDialog();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.