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. dynamic form programming

dynamic form programming

Scheduled Pinned Locked Moved C#
csharpdesignxmlquestionworkspace
4 Posts 4 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.
  • P Offline
    P Offline
    ppp001
    wrote on last edited by
    #1

    Hi all, is there any means to program a dynamic form at runtime by c# ? I mean to create a form with controls whose positions or control type are determined at runtime ? e.g. can I program the code to read in a xml file for the configuration(the list of controls and its position) of the form to render the form UI to the users at runtime ? Thanks

    D S M 3 Replies Last reply
    0
    • P ppp001

      Hi all, is there any means to program a dynamic form at runtime by c# ? I mean to create a form with controls whose positions or control type are determined at runtime ? e.g. can I program the code to read in a xml file for the configuration(the list of controls and its position) of the form to render the form UI to the users at runtime ? Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Yes you can. It's no different from the code generated by the Windows Form Designer. You can find examples of this all over, but especially if you look at the Windows Forms Designer generated code section of a form created in the designer. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • P ppp001

        Hi all, is there any means to program a dynamic form at runtime by c# ? I mean to create a form with controls whose positions or control type are determined at runtime ? e.g. can I program the code to read in a xml file for the configuration(the list of controls and its position) of the form to render the form UI to the users at runtime ? Thanks

        S Offline
        S Offline
        Spanky3
        wrote on last edited by
        #3

        sure create a template say using a table layour which contains place holders for the items which you wish to add at runtime. Depending on the circumstances add the controls you wish according to the situation. Placeholders are simply like frames which use no code and no resources they are simply spaces to put controls inside. From member to add the items you would use placeholder.add(object) something along these lines. You could as you say use XML which contains say configurations on the user types, you could then use the XML reader to load the controls in. Placeholders would be your best option as they are built for this dynamic content changing situation Atul

        1 Reply Last reply
        0
        • P ppp001

          Hi all, is there any means to program a dynamic form at runtime by c# ? I mean to create a form with controls whose positions or control type are determined at runtime ? e.g. can I program the code to read in a xml file for the configuration(the list of controls and its position) of the form to render the form UI to the users at runtime ? Thanks

          M Offline
          M Offline
          Michael P Butler
          wrote on last edited by
          #4

          pyhtang1 wrote: e.g. can I program the code to read in a xml file for the configuration(the list of controls and its position) of the form to render the form UI to the users at runtime ? I recommend you have a look at MyXaml[^] Michael CP Blog [^]

          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