How to lay out a form with multiple views
-
Hello! I am rather new to Windows Forms programming. I have made simple applications that have only one view (you launch the application, what you see on the screen is what is always there). I am trying to get into some more advanced programming. I currently have a tab control with several tabs. On one of the tabs, the left hand side has a TreeView that is docked to the left. As the user clicks on items in the treeview, I want to display some information on the right hand portion of the screen about the item that they have selected. What I am trying to do is figure out how to use the Windows Designer in order to design multiple views, and swap them in and out at runtime. (ie, if the user clicks on a Customer in the tree view, the right hand side would display information about that customer. If they click an office location under that customer in the treeview, I want to display a completely different set of group boxes, buttons, etc on the right hand side) (Kind of exactly what a tab control does, but without the tab control!) I can place all of the controls on the right hand side, or on a panel, and make them visible and invisible at runtime, or I could always programatically create the controls on the fly --- but it is very hard for me to visualize it and make it look proper. I am wondering what ways you all use in order to design a more complex application like this. I have been reading and cannot seem to find the proper "keywords" to point me in the right direction. Any help would be incredibly appreciated!! Thanks in advance!
-
Hello! I am rather new to Windows Forms programming. I have made simple applications that have only one view (you launch the application, what you see on the screen is what is always there). I am trying to get into some more advanced programming. I currently have a tab control with several tabs. On one of the tabs, the left hand side has a TreeView that is docked to the left. As the user clicks on items in the treeview, I want to display some information on the right hand portion of the screen about the item that they have selected. What I am trying to do is figure out how to use the Windows Designer in order to design multiple views, and swap them in and out at runtime. (ie, if the user clicks on a Customer in the tree view, the right hand side would display information about that customer. If they click an office location under that customer in the treeview, I want to display a completely different set of group boxes, buttons, etc on the right hand side) (Kind of exactly what a tab control does, but without the tab control!) I can place all of the controls on the right hand side, or on a panel, and make them visible and invisible at runtime, or I could always programatically create the controls on the fly --- but it is very hard for me to visualize it and make it look proper. I am wondering what ways you all use in order to design a more complex application like this. I have been reading and cannot seem to find the proper "keywords" to point me in the right direction. Any help would be incredibly appreciated!! Thanks in advance!
I normally create each "View" as UserControl. That makes it simple to create more complex views but set only a single controls Visible state. You can also see it in designer mode without all the clutter of a panel embedded in a splitter on a main form. Not sure that's what you were asking about.
led mike
-
I normally create each "View" as UserControl. That makes it simple to create more complex views but set only a single controls Visible state. You can also see it in designer mode without all the clutter of a panel embedded in a splitter on a main form. Not sure that's what you were asking about.
led mike
I just spent some time reading about the UserControls class, this does look like it would work for what I am trying to do. My question is, how would I go about designing it in Designer Mode? It'd be great if you could design multiple panels "off canvas" or off the application, put all your controls on them, make them look good, and then drag the panel onto the application on top of the other panels with the other controls (that's what I'm trying to do). Thanks!!
-
I just spent some time reading about the UserControls class, this does look like it would work for what I am trying to do. My question is, how would I go about designing it in Designer Mode? It'd be great if you could design multiple panels "off canvas" or off the application, put all your controls on them, make them look good, and then drag the panel onto the application on top of the other panels with the other controls (that's what I'm trying to do). Thanks!!
-
I just spent some time reading about the UserControls class, this does look like it would work for what I am trying to do. My question is, how would I go about designing it in Designer Mode? It'd be great if you could design multiple panels "off canvas" or off the application, put all your controls on them, make them look good, and then drag the panel onto the application on top of the other panels with the other controls (that's what I'm trying to do). Thanks!!
Why don't you just embed the 'layouts' in panels. When the layout changes hide one panel and show another. When the selection changes but layout does not then just change the information for that particular layout panel.
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios Discounted or Free Software for Students: DreamSpark - downloads.channel8.msdn.com MSDN Academic Alliance - www.msdnaa.com
-
Hello! I am rather new to Windows Forms programming. I have made simple applications that have only one view (you launch the application, what you see on the screen is what is always there). I am trying to get into some more advanced programming. I currently have a tab control with several tabs. On one of the tabs, the left hand side has a TreeView that is docked to the left. As the user clicks on items in the treeview, I want to display some information on the right hand portion of the screen about the item that they have selected. What I am trying to do is figure out how to use the Windows Designer in order to design multiple views, and swap them in and out at runtime. (ie, if the user clicks on a Customer in the tree view, the right hand side would display information about that customer. If they click an office location under that customer in the treeview, I want to display a completely different set of group boxes, buttons, etc on the right hand side) (Kind of exactly what a tab control does, but without the tab control!) I can place all of the controls on the right hand side, or on a panel, and make them visible and invisible at runtime, or I could always programatically create the controls on the fly --- but it is very hard for me to visualize it and make it look proper. I am wondering what ways you all use in order to design a more complex application like this. I have been reading and cannot seem to find the proper "keywords" to point me in the right direction. Any help would be incredibly appreciated!! Thanks in advance!
I will usually create all the "views" as Windows Forms. In that I can change to SDI, MDI easily. For your case, place a panel as your right container, when user click on item in the treeview, create the appropriate form and do these: form.ControlBox = false; form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; form.Dock = DockStyle.Fill; form.MaximizeBox = false; form.MinimizeBox = false; form.TopLevel = false; pnlContainer.Controls.Add(form); form.Show(); form.BringToFront(); The "form" will be shown within the panel. I don't usually use UserControl for this kind of purpose, as I feel it's more restrictive for my liking.
-
Hello! I am rather new to Windows Forms programming. I have made simple applications that have only one view (you launch the application, what you see on the screen is what is always there). I am trying to get into some more advanced programming. I currently have a tab control with several tabs. On one of the tabs, the left hand side has a TreeView that is docked to the left. As the user clicks on items in the treeview, I want to display some information on the right hand portion of the screen about the item that they have selected. What I am trying to do is figure out how to use the Windows Designer in order to design multiple views, and swap them in and out at runtime. (ie, if the user clicks on a Customer in the tree view, the right hand side would display information about that customer. If they click an office location under that customer in the treeview, I want to display a completely different set of group boxes, buttons, etc on the right hand side) (Kind of exactly what a tab control does, but without the tab control!) I can place all of the controls on the right hand side, or on a panel, and make them visible and invisible at runtime, or I could always programatically create the controls on the fly --- but it is very hard for me to visualize it and make it look proper. I am wondering what ways you all use in order to design a more complex application like this. I have been reading and cannot seem to find the proper "keywords" to point me in the right direction. Any help would be incredibly appreciated!! Thanks in advance!
Use usercontrols to design the different pages of your application, next find intel on "triggering a userform/form control from other form/userform". Use delegates. Place a new post if you need this :doh: