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. C#
  4. Proper way of creating a form with multiple pages

Proper way of creating a form with multiple pages

Scheduled Pinned Locked Moved C#
csharpvisual-studiowinformsdesignalgorithms
7 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.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hello Everyone- I'm just getting started with doing some Windows Forms programming. I'm wondering what the proper way to go about designing a Form with multiple pages in it is. I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them. Here's an example of what I want to do. If you've ever seen Outlook. Left hand side there is a bunch of options. Calendar, Mail, etc. You click Calendar and the right hand page shows you the calendar view. If you click on Mail, the right hand side shows you your mail. I'm looking to have functionality similar to this. You select an option on the left hand side, and the right hand page is displayed based on what the end user wants to do. I'm wondering if it is possible to create all of this in the Visual Studio Editor so I can draw controls and size them and all that good stuff. What I am basically looking to do is almost have a Tab Control on the right hand side with multiple tabs and different controls on those tabs, and the ability to edit them easily in the editor (like with the tab control, you click on the page and presto, you can draw whatever you like on there) ... looking for the tab control without the tabs on the top! Thanks so much in advance. I'm just looking to be pointed in the proper direction is all. Spent two hours searching but can't find exactly what I am looking for.

    C 1 Reply Last reply
    0
    • S shultas

      Hello Everyone- I'm just getting started with doing some Windows Forms programming. I'm wondering what the proper way to go about designing a Form with multiple pages in it is. I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them. Here's an example of what I want to do. If you've ever seen Outlook. Left hand side there is a bunch of options. Calendar, Mail, etc. You click Calendar and the right hand page shows you the calendar view. If you click on Mail, the right hand side shows you your mail. I'm looking to have functionality similar to this. You select an option on the left hand side, and the right hand page is displayed based on what the end user wants to do. I'm wondering if it is possible to create all of this in the Visual Studio Editor so I can draw controls and size them and all that good stuff. What I am basically looking to do is almost have a Tab Control on the right hand side with multiple tabs and different controls on those tabs, and the ability to edit them easily in the editor (like with the tab control, you click on the page and presto, you can draw whatever you like on there) ... looking for the tab control without the tabs on the top! Thanks so much in advance. I'm just looking to be pointed in the proper direction is all. Spent two hours searching but can't find exactly what I am looking for.

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

      shultas wrote:

      I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them.

      Of course - there's a forms designer in visual studio. The way I'd do this, is to create controls for all the views, put them all in a control, and just change which one is visible as the option is selected to show them.

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      S L 2 Replies Last reply
      0
      • C Christian Graus

        shultas wrote:

        I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them.

        Of course - there's a forms designer in visual studio. The way I'd do this, is to create controls for all the views, put them all in a control, and just change which one is visible as the option is selected to show them.

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        S Offline
        S Offline
        shultas
        wrote on last edited by
        #3

        Ok I'm familiar with the form designer in VS. What I'm not familiar with is ... "create controls for all the views, put them all in a control, and just change which one is visible". So "Put them all in a control", what control? What would I draw using the forms designer to place all of these controls into? I was thinking of something such as a panel, but when I set Visible of the panel to false in the designer it does not "disappear" from view, making it impossible to draw multiple panels with multiple controls and design it easily. Thanks!!

        C 1 Reply Last reply
        0
        • C Christian Graus

          shultas wrote:

          I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them.

          Of course - there's a forms designer in visual studio. The way I'd do this, is to create controls for all the views, put them all in a control, and just change which one is visible as the option is selected to show them.

          Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I agree this is my approach as well, one main application view which has a panel or any sort of container to hold other possible views, this makes for the best possible approach as far as i know to allow as much extensionability or maintainability as possible.

          Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

          1 Reply Last reply
          0
          • S shultas

            Ok I'm familiar with the form designer in VS. What I'm not familiar with is ... "create controls for all the views, put them all in a control, and just change which one is visible". So "Put them all in a control", what control? What would I draw using the forms designer to place all of these controls into? I was thinking of something such as a panel, but when I set Visible of the panel to false in the designer it does not "disappear" from view, making it impossible to draw multiple panels with multiple controls and design it easily. Thanks!!

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

            shultas wrote:

            So "Put them all in a control", what control?

            Any control you like. Create a user control for each pane, you can set that up in the designer. create a control to hold them all with a property to set which one is visible.

            shultas wrote:

            when I set Visible of the panel to false in the designer it does not "disappear" from view,

            Which is why you create each one as a seperate control, THEN put them all together.

            Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

            S 1 Reply Last reply
            0
            • C Christian Graus

              shultas wrote:

              So "Put them all in a control", what control?

              Any control you like. Create a user control for each pane, you can set that up in the designer. create a control to hold them all with a property to set which one is visible.

              shultas wrote:

              when I set Visible of the panel to false in the designer it does not "disappear" from view,

              Which is why you create each one as a seperate control, THEN put them all together.

              Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

              S Offline
              S Offline
              shultas
              wrote on last edited by
              #6

              Righteous. That's exactly what I was looking for, the proper thing to do, which appears to be a User Control! Now I can go look up how to do that! Thank you very much I really appreciate you taking a few moments to help me out.

              C 1 Reply Last reply
              0
              • S shultas

                Righteous. That's exactly what I was looking for, the proper thing to do, which appears to be a User Control! Now I can go look up how to do that! Thank you very much I really appreciate you taking a few moments to help me out.

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

                no worries, glad to help.

                Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

                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