|
-
December 30th, 2004, 04:42 AM
#1
Problem with Multiple Forms App (VS 2003B)
I am 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..
private:
void CreateMyChildForm ()
{
// Create a new form to represent the child form.
Form* child = new Form();
// Increment the private child count.
childCount++;
// 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.
child->Show();
}
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..
PLS HELP
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|