Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Viewing previous form

Viewing previous form

Scheduled Pinned Locked Moved Windows Forms
csharpc++helpquestion
5 Posts 4 Posters 41 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Debun
    wrote on last edited by
    #1

    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

    T C 2 Replies Last reply
    0
    • D Debun

      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

      T Offline
      T Offline
      Tarakeshwar Reddy
      wrote on last edited by
      #2

      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()

      1 Reply Last reply
      0
      • D Debun

        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

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        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 )

        R 1 Reply Last reply
        0
        • C Christian Graus

          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 )

          R Offline
          R Offline
          ronenfe
          wrote on last edited by
          #4

          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.

          R 1 Reply Last reply
          0
          • R ronenfe

            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.

            R Offline
            R Offline
            ronenfe
            wrote on last edited by
            #5

            Never mind , I found a solution at: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1021032&SiteID=1[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups