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. Multiple Forms\Views

Multiple Forms\Views

Scheduled Pinned Locked Moved C#
csharpc++jsonarchitecturequestion
3 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
    SanShou
    wrote on last edited by
    #1

    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.

    C 1 Reply Last reply
    0
    • S SanShou

      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.

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      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!

      L 1 Reply Last reply
      0
      • C CWIZO

        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!

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

        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.

        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