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. Managed C++/CLI
  4. How to switch to Form Designer for inserted Form.h?

How to switch to Form Designer for inserted Form.h?

Scheduled Pinned Locked Moved Managed C++/CLI
questionc++dotnettutorial
6 Posts 3 Posters 0 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.
  • U Offline
    U Offline
    uusheikh
    wrote on last edited by
    #1

    I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks

    M D 2 Replies Last reply
    0
    • U uusheikh

      I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      uus831 wrote:

      Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer.

      What if you copy and add the Form1.resx file to the new project as well? Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      U 1 Reply Last reply
      0
      • M Mark Salsbery

        uus831 wrote:

        Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer.

        What if you copy and add the Form1.resx file to the new project as well? Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        U Offline
        U Offline
        uusheikh
        wrote on last edited by
        #3

        Hi, i tried that too, but its just the same. I cant switch to form designer.

        1 Reply Last reply
        0
        • U uusheikh

          I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It's like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually? I'm using VS2008 C++/CLR. Thanks

          D Offline
          D Offline
          dybs
          wrote on last edited by
          #4

          I ran into a similar problem not long ago (using VS2005 Pro). Here's how I solved it 1. In the project you want a copy of the Form1, simply add a new Form object. Be sure to call it Form1 was well (or whatever you called it in your original project). 2. Delete the .h and .cpp files for the form you just created. Leave the .resx file alone. 3. Copy Form1.h and Form1.cpp from your original project to your new project and compile. Be sure to rename them to whatever you called the form you just deleted. Since your copied form is now the same name, it should work just fine. I'm not certain if this is exactly what I did, but I have it documented at work. I can check on it Monday. Dybs

          U 1 Reply Last reply
          0
          • D dybs

            I ran into a similar problem not long ago (using VS2005 Pro). Here's how I solved it 1. In the project you want a copy of the Form1, simply add a new Form object. Be sure to call it Form1 was well (or whatever you called it in your original project). 2. Delete the .h and .cpp files for the form you just created. Leave the .resx file alone. 3. Copy Form1.h and Form1.cpp from your original project to your new project and compile. Be sure to rename them to whatever you called the form you just deleted. Since your copied form is now the same name, it should work just fine. I'm not certain if this is exactly what I did, but I have it documented at work. I can check on it Monday. Dybs

            U Offline
            U Offline
            uusheikh
            wrote on last edited by
            #5

            Thanks!!! It works! I have tried, and it works great. Except, that you need to rename the namespace so that it is the same in the new project. Great tip! Thanks again.

            D 1 Reply Last reply
            0
            • U uusheikh

              Thanks!!! It works! I have tried, and it works great. Except, that you need to rename the namespace so that it is the same in the new project. Great tip! Thanks again.

              D Offline
              D Offline
              dybs
              wrote on last edited by
              #6

              Oh yeah, kinda forgot the namespace thing :) No problem, glad to help. Dybs

              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