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. Reusing Forms

Reusing Forms

Scheduled Pinned Locked Moved C#
csharpdelphiquestionworkspace
2 Posts 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I'm fairly new to the C# environment but coming from Delphi, most of what we've been doing has been very familiar. Primarily, the difference has been syntax and a few new features we didn't have. An important technique we used a lot was the reusing of forms. This was done by creating a form, such as an address form, and reuse it in several areas. The exact same form would be used in the maintenance of people, shipping, billing, etc. while and underlying class property dictated the rules of the form. Why do this? The flexibility and look of MDI was not nearly what we desired or needed. Instead, we created a form with panels in it. We then positioned the panels where we wanted them. We could then take a completed form (whose parent is SELF by default) and set the parent property to the panel. The second line of code set the form's alignment to client. This essentially pasted the form into the panel. This gave us the ability to have a developer build the central application while other tasks were divided by specialty. Now, if I were putting together something that needed the module that needed an address, I'd put a panel in the main application and just paste the address form into the panel at run time. I'd them use the class methods and procedures to move information appropriately. What I'd like to do is perform this same type of task in C#. I've tried a few things but I'm not getting past the fact that a form is a "top level control". The impression I get is C# treats controls in a heirarchal form and a panel is lower than a form. Once the form is identified as such, I'm not allowed to put the form into a "lower" type control. Are there any suggestions for doing something similar to this? This is quite a powerful technique that can be utilized even better in C# than in Delphi because of the ability to build multiple interfaces (shipping address maintenance, billing address maintenance, personal address maintenance, etc) and utilize them as the task requires.

    A 1 Reply Last reply
    0
    • L Lost User

      I'm fairly new to the C# environment but coming from Delphi, most of what we've been doing has been very familiar. Primarily, the difference has been syntax and a few new features we didn't have. An important technique we used a lot was the reusing of forms. This was done by creating a form, such as an address form, and reuse it in several areas. The exact same form would be used in the maintenance of people, shipping, billing, etc. while and underlying class property dictated the rules of the form. Why do this? The flexibility and look of MDI was not nearly what we desired or needed. Instead, we created a form with panels in it. We then positioned the panels where we wanted them. We could then take a completed form (whose parent is SELF by default) and set the parent property to the panel. The second line of code set the form's alignment to client. This essentially pasted the form into the panel. This gave us the ability to have a developer build the central application while other tasks were divided by specialty. Now, if I were putting together something that needed the module that needed an address, I'd put a panel in the main application and just paste the address form into the panel at run time. I'd them use the class methods and procedures to move information appropriately. What I'd like to do is perform this same type of task in C#. I've tried a few things but I'm not getting past the fact that a form is a "top level control". The impression I get is C# treats controls in a heirarchal form and a panel is lower than a form. Once the form is identified as such, I'm not allowed to put the form into a "lower" type control. Are there any suggestions for doing something similar to this? This is quite a powerful technique that can be utilized even better in C# than in Delphi because of the ability to build multiple interfaces (shipping address maintenance, billing address maintenance, personal address maintenance, etc) and utilize them as the task requires.

      A Offline
      A Offline
      Andy Smith
      wrote on last edited by
      #2

      make these "forms" as usercontrols instead.

      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