mardi 31 mars 2015

How to create a VS 2008 Windows Forms project programmatically, that can be maintained just like any other project created manually

I have a bunch of control properties (type of control, location, size, etc.) derived as a text file from an old system on a different platform. I thought it would be fairly easy to load these "control descriptions" into a Windows Forms project in VS 2008 and then be able to maintain the new project in VS just as if it had been created manually.


I'm familiar with using VS and C# but it I'm not sure where to start with this.


I searched the web and found a number of articles about creating controls on forms at run time and that is not so hard, given the information I have, but I want the created form to be a permanent part of a Win Forms project, so I need to get what was created at run time into VS, and accessible in the project just as if it had been manually dropped on the designer surface. Is there a way I could create these forms with a program and then "save" them in a form acceptable to VS?


I manually created a windows Form project to try and use as a "template" and identify how VS does it. I have tried to understand the contents and the relationships between the various resource files, but it is a bit too much. There are also warnings that various files are created by VS and should not be amended manually.


I have almost 1000 forms from the old system so the thought of manually having to add each one to VS is pretty non-viable. I could translate the text descriptions into XML if there is a way to feed an XML description of a Form into a VS Forms project...?


Any advice\direction towards this would be greatly appreciated.


Aucun commentaire:

Enregistrer un commentaire