Problem with Multiple Forms Application (VS 2003B)

Iam using Visual Studio.Net 2003B and I have to say that i am really pleased with
the Studio's Form Designer...It really helps you handle the events ,the properties and many other things.
BUT I have some problems with the organisation of the Forms the Designer proposes(or is it forces you..?).
It implements a form as a Form.h library file and a main CppForm for example .cpp file which calls the
Forms class at the beginning.
Application::Run(new Form1());

Let's say i create a second form using Studio's Wizard,Add New Item->Windows Form.
That means a second Form2.h and a Form2.cpp is created.

What i want to do is by clicking a button at the Form1 to Show Form2..
How do I do that.

Does it have anything to do with PArent and Child Forms?
I found the following code for Child and Parent Forms but the problem is i want to
put this code into the Form1.h event handler for my button..


void CreateMyChildForm ()


// Create a new form to represent the child form.

Form* child = new Form();

// Increment the private child count.


// Set the text of the child form using the count of child forms.

String* formText = String::Format( S"Child {0}", __box(childCount));

child->Text = formText;

// Make the new form a child form.

child->MdiParent = this;

// Display the child form.



If i want to fire a new instance of Form2 class how would i do it as far as the event handler of Button1 let's say
is in Form1.h and cannot "see" the Form2 class located in Form2.h..
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!