verwenden Sie die folgende Funktion.
Edit your .cpp file and arrange the #include directives, putting the 2nd form first:
PHP Code:
#include "Form2.h"
#include "Form1.h"
Then write code like this in, say, a button's Click event handler:
PHP Code:
System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Form2^ frm = gcnew Form2;
frm->Show(this);
}