Multiple Forms\Views
-
Hey All, I am looking for some advice. I am pretty new to C# with a little experience making form based windows applications that are pretty quick and dirty just to get them done (such as my psudeo translator that allows me to replace characters in a resource file with Japanese characters to test localization of products.) However I am trying to do something new which is to create an application that has multiple forms, however I am not a big fan of having several different windows open on the screen free floating when they could be wrapped in a single window. I would like a cleaner solution than closing one window with form1 and opening a new window with form2 on it. After looking at my options I came up with several ways of doing this: 1) Instead of creating several forms, just use several panels that hide the controls based on a view switch. This seems cumbersome to do with the form designer, but seems possible if I hand write everything. I think this would work the way I want it to. Also I am a little afraid that this might mean all the code is in the form1 class which would be hard to maintain. 2) Not sure if I could just create a custom control that mimics the functionality that I looking for and then hide and show these based on views. This would allow me to create different elements of each control and re-use some other external controls such as listviews for displaying drag and drop elements. Not sure what I just said or if I can accurately express what I was thinking. 3) Rewrite the MFC Formview architecture in C#. Sounds like a lot of work but it may be worth it in the long run. Then I can feel like I accomplished something. Just not sure that it would be any better than a simplier idea though.... Any advice from someone that knows a bit more... Am I missing something (other than my own sanity)? Thanks, Brian If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
-
Hey All, I am looking for some advice. I am pretty new to C# with a little experience making form based windows applications that are pretty quick and dirty just to get them done (such as my psudeo translator that allows me to replace characters in a resource file with Japanese characters to test localization of products.) However I am trying to do something new which is to create an application that has multiple forms, however I am not a big fan of having several different windows open on the screen free floating when they could be wrapped in a single window. I would like a cleaner solution than closing one window with form1 and opening a new window with form2 on it. After looking at my options I came up with several ways of doing this: 1) Instead of creating several forms, just use several panels that hide the controls based on a view switch. This seems cumbersome to do with the form designer, but seems possible if I hand write everything. I think this would work the way I want it to. Also I am a little afraid that this might mean all the code is in the form1 class which would be hard to maintain. 2) Not sure if I could just create a custom control that mimics the functionality that I looking for and then hide and show these based on views. This would allow me to create different elements of each control and re-use some other external controls such as listviews for displaying drag and drop elements. Not sure what I just said or if I can accurately express what I was thinking. 3) Rewrite the MFC Formview architecture in C#. Sounds like a lot of work but it may be worth it in the long run. Then I can feel like I accomplished something. Just not sure that it would be any better than a simplier idea though.... Any advice from someone that knows a bit more... Am I missing something (other than my own sanity)? Thanks, Brian If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
-
If you just don't want for your other forms to show in task bar, then set ShowInTaskbar property to false. Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
Thanks for the suggestion. My biggest problem with multiple windows is the flow and controlling the user experience. I know that I often get frustrated with the amount of free floating windows in some applications and trying to get them positioned just right so I feel like I can use them. I don't mind dockable windows but only within the context of the view. I also don't really like a completely dialog based application with a stagnant main window. Sometimes I wish I was just plain satisfied but no I have to have this critical streak in me.... If I show and hide each window but it is not in the task bar then how do they get back to the correct window? I guess I could mimic switching by having the previous form size the next form to its own size, then tell the previous form to hide itself (both minimized and remove itself the taskbar). It seems lit a bit of a hack but I think it might work. Not sure what the performance would be like.. Is there a way of sharing menus and toolbars between forms? Any other ideas or opinions? Thanks, Brian If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.