App design using Panel controls

LabProARW

Well-known member
Joined
Nov 4, 2019
Messages
52
Programming Experience
1-3
I started a database app using a LeftPanelMainMenu for buttons with which to load each form which does its own particular functions . The forms as they open are displayed inside (or on top of) MainContentPanel. It looked fine and worked each form opening and closing after its work was done and close button. It was suggested to me that instead of opening one form at a time and closing (which seems like an old school design), that some of the forms have related purposes so could be opened on side by side panels simultaneously somewhat like a dashboard view. I'm having problems opening/coding so that the previous working form will open on a Panel (LeftPanel) which sets on top of MainContentPanel... and another related form to open in RightPanel which also sets on top of MainContentPanel. *The ultimate goal is to open my frmMain and have both of these open automatically in their respective Panels. I'm having trouble with the syntax to specify where (which panel) I want each of the forms to go. Many of my internet searches don't do this particular action so I'm stuck.

Thank you for your time and comments.
 
How exactly are you trying to get your form to sit inside the panels? Are you doing the set the Parent trick? Showing us some minimal code that demonstrates the problem would help a lot.

In general, it is a bad idea to try put a Form inside a Panel. Yes, it sort of works as and that is what ends up frustrating beginners because when it stops working or starts acting weird then you've already sunk so much time into it before figuring out that you should have done it the right way in the first place.

If you wrote your code such that a Forrm hosted a UserControl, then you could simply have the Panel host the UserControl, this requires minimal work -- assuming that you had planned ahead. Doing the transplant of the controls from Form into a UserControl after the fact tends to be tedious and error prone, as well as leads to some interesting architectural problems if you were not disciplined about keeping your View separate from your Model and your Business Logic.
 
<joking>But isn't MDI even more old fashioned looking than having multiple forms? SDI was king for a long time until people got just used to lots of modal dialog boxes due to their phone apps.</joking>

My reading of the original post is that the @LabProARW 's program has several "modes" of operation. Currently each of those operations are activated by select buttons on the left pane, and a new form appears on the right pane which was also his main content pane. But some of the operations are related to each other, and so the idea is that more than one form will appear: one on the right pane, and one on the left pane. I think it's almost like when Visual Studio has default content in the various panes while you are in code editing "mode", but when you start the debugger, different content shows up in those panes, and yet again different content shows up if you are doing profiling, or doing database related stuff.

To me it's not clear how if in the OP's left and right panes are occupied by his "forms", how will the user then move on to a different mode of operation if the buttons that used to be in the left pane are not there anymore.
 
Last edited:
I started a database app using a LeftPanelMainMenu for buttons with which to load each form which does its own particular functions . The forms as they open are displayed inside (or on top of) MainContentPanel. It looked fine and worked each form opening and closing after its work was done and close button. It was suggested to me that instead of opening one form at a time and closing (which seems like an old school design), that some of the forms have related purposes so could be opened on side by side panels simultaneously somewhat like a dashboard view. I'm having problems opening/coding so that the previous working form will open on a Panel (LeftPanel) which sets on top of MainContentPanel... and another related form to open in RightPanel which also sets on top of MainContentPanel. *The ultimate goal is to open my frmMain and have both of these open automatically in their respective Panels. I'm having trouble with the syntax to specify where (which panel) I want each of the forms to go. Many of my internet searches don't do this particular action so I'm stuck.

Thank you for your time and comments.

The description of your original (current) design sounds like a tab control, except tab controls typically have the buttons horizontally. As fa as being an old design, note that Microsoft Edge, when using tabs, has buttons at the top or on the left. Am I correct that your design that people are criticizing is much like Edge when the links for each website is on the left?

What do you mean by related purposes? Is there a need to see more than one form at a time? Unless there is, I think there is no need to change what you have. It does not make sense to change something only because it is old.

I do not understand the layout you are attempting to create. Are you attempting to create a window with the menu on the left and two other panels for forms?

Many people try to use a Multiple Document Interface (MDI) design as if it is designed to provide multiple windows. Its fundamental purpose is to provide an interface for multiple documents. Microsoft does not make that clear in the .Net documentation. See About the Multiple Document Interface - Win32 apps | Microsoft Learn; it is very clear about the design and intended use of MDI.
 

Latest posts

Back
Top Bottom