How do I create a form at runtime from an XML stream?

  • Thread starter Thread starter Anthony Davis
  • Start date Start date
A

Anthony Davis

Hello All,
I am designing an application for a client, and it requires that the
user interface be dynamic. It is a survey application that will run on
Pocket PC and on Windows CE. Whenever the application is loaded the
user enters a survey ID and the application will go to the server and
download the survey in XML, then dynamically create the Forms for the
survey.

I am still fairly new to C#, does anyone have a good link to a
reference or example about how I should go about creating the dynamic
form creation?

Beat Regards,
Anthony
 
Well FOrm creation is always dynamic - the best resource is the
InitiaizeComponent section the designer writes. Basically you need to take
your XML, decide how that equates to controls on a Form, then create, place
and parent them just like InitializeComponents does. Wiring up events will
be more challenging, but if you have pre-defined event handlers for all
possible object types it shouldn't be too bad either.
 
Back
Top