Hi,

I am developing a GUI using visual C++ 2005 express edition. I created a window forms (form1.h) with some buttons and codes. Next I added another new window forms (form2.h)with a single button.

I wish to link the form2.h to form1.h with a single button click. I searched and tried many method provided in forum but still not working.

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 form1.Show();
			 }

I keep getting the error of form1 not identify. Why is it so? Can some1 provide me some help?

Thanks.

Regards,

Adrian

Any help pls? I need this urgently....

>>I keep getting the error of form1 not identify. Why is it so?
Could be thousands of reasons, but most likely you failed to include the header file in the *.cpp file. Or to declare form1 somewhere.

Hi,

Thanks for reply. I tried to include the header file in *cpp but I still getting the same error and can't link up two window forms. Here I attached my file (http://developer.sonyericsson.com/thread/44297), hope you can provide me some advice. I really need this in urgent.

Million thanks in advance.

Regards,

Adrian

Hi,

I already link up the two window forms. But the second window form juz appear for less than 1 sec, here is what I wrote:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                Form2().Show();
                Form2().Activate();
                Form1().Close();
 }

how can I hold it can hide the first window form?

Hi,

I did it, thanks.

Hi,

I faced the same the same problem again when I tried to link up 3 window forms.....Can someone pls have a look on the attached file.......I simplify the example using form1 form2 and form3.....PLS....need it in urgent.....

Regards,

Adrian

Anyhelp? I still facing the same problem....

use Form2().ShowDialog(); instead of Form2().Show(); This way it'll stay there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.