Viewing previous form
-
Hello, I am implementing an application in VC++ on the .Net Platform. I have 3 forms Form1 , Form2 and Form3. The program when it starts running loads form1 and then proceeds to Form2 and then Form3 . I want to be able to got back to Form2 from Form3 and then go back from Form2 to Form1. I have tried doing this with this code on Form2 but i get error message "Form1 is not a class or namespace". Form2::Hide(); Form1::Show(); please can you tell me what i'm doing wrong?:(( dee
-
Hello, I am implementing an application in VC++ on the .Net Platform. I have 3 forms Form1 , Form2 and Form3. The program when it starts running loads form1 and then proceeds to Form2 and then Form3 . I want to be able to got back to Form2 from Form3 and then go back from Form2 to Form1. I have tried doing this with this code on Form2 but i get error message "Form1 is not a class or namespace". Form2::Hide(); Form1::Show(); please can you tell me what i'm doing wrong?:(( dee
You could pass the instance of the form1 to form2 via the constructor and that would allow you to do objform1::Show() inside form2. Or You could use the singleton pattern to get the instance of the form object and do a ::Show() ::Hide()
-
Hello, I am implementing an application in VC++ on the .Net Platform. I have 3 forms Form1 , Form2 and Form3. The program when it starts running loads form1 and then proceeds to Form2 and then Form3 . I want to be able to got back to Form2 from Form3 and then go back from Form2 to Form1. I have tried doing this with this code on Form2 but i get error message "Form1 is not a class or namespace". Form2::Hide(); Form1::Show(); please can you tell me what i'm doing wrong?:(( dee
Debun wrote:
Form2::Hide(); Form1::Show();
You're hoping those methods are static, and they are not. The easiest way to do this, is to make your three forms user controls, and hide/show them within the one form.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Debun wrote:
Form2::Hide(); Form1::Show();
You're hoping those methods are static, and they are not. The easiest way to do this, is to make your three forms user controls, and hide/show them within the one form.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
I also have exactly the same problem, how do I create the user controls? I am using visual c++ 2005 express. I'm using form1 as mdicontainer. The other suggestion doesn't work for me: I can't do #include "Form1.h" in the form2 header, it gives a lot of errors doing that. Because of this, I can't pass "this" pointer of form1 to form2.
-
I also have exactly the same problem, how do I create the user controls? I am using visual c++ 2005 express. I'm using form1 as mdicontainer. The other suggestion doesn't work for me: I can't do #include "Form1.h" in the form2 header, it gives a lot of errors doing that. Because of this, I can't pass "this" pointer of form1 to form2.