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