Proper way of creating a form with multiple pages
-
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.
-
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.
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
-
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
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!!
-
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
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![^]
-
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!!
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
-
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
-
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.
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