0

Okay I am probably going to get a load of down votes for this question as it is incredibly basic but I cannot seem to find my solution from googling it. I am using visual c++ 2005 .net and I am creating forms in the style of a wizard. I basically want a button to be clicked to get to the next form. The first form is Form1.h and the form I want it to go to is called Parts.h Any help would be appreciated, thank you.

Here is the code:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
bigbaz34
  • 385
  • 2
  • 8
  • 27
  • possible duplicate of [Creating Wizards for Windows Forms in C#](http://stackoverflow.com/questions/2340566/creating-wizards-for-windows-forms-in-c-sharp) – Hans Passant Nov 09 '11 at 15:34

1 Answers1

1

Basically, you need to create a new instance of the form you want to open, and then show it. You can do it by doing something like this:

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

Plus, you need to include the second form on the form that is going to open it.

seth
  • 1,401
  • 1
  • 17
  • 28
  • Isn't this visual basic not visual c++? – bigbaz34 Nov 09 '11 at 15:35
  • Yes, you're right. My mistake. Although, the conversion to c++ should be pretty simple. Just create a new instance of your form, and then use the ShowDialog method to show it. – seth Nov 09 '11 at 15:41