c# - How to compile and add the form designed by user to a project -


i going let users create forms during runtime , add them project. have done designing , ui of form of open source form designer.

here image of form designer: image

lets assume have form1.cs , form1.cs[designer] files enough winform. how compile dll or exe , add project? ideas? clues?

thanks!!

edit

it creates code.

public partial class form1 : form {     public form1()     {         initializecomponent();     }      private system.windows.forms.button button1;      private system.windows.forms.textbox textbox1;      private system.windows.forms.checkbox checkbox1;       private void initializecomponent()     {         this.button1 = new system.windows.forms.button();         this.textbox1 = new system.windows.forms.textbox();         this.checkbox1 = new system.windows.forms.checkbox();         this.suspendlayout();         //          // button1         //          this.button1.location = new system.drawing.point(71, 49);         this.button1.name = "button1";         this.button1.size = new system.drawing.size(75, 23);         this.button1.tabindex = 0;         this.button1.text = "button1";         this.button1.usecompatibletextrendering = true;         this.button1.usevisualstylebackcolor = true;         //          // textbox1         //          this.textbox1.location = new system.drawing.point(71, 94);         this.textbox1.name = "textbox1";         this.textbox1.size = new system.drawing.size(100, 20);         this.textbox1.tabindex = 1;         //          // checkbox1         //          this.checkbox1.location = new system.drawing.point(38, 184);         this.checkbox1.name = "checkbox1";         this.checkbox1.size = new system.drawing.size(104, 24);         this.checkbox1.tabindex = 2;         this.checkbox1.text = "checkbox1";         this.checkbox1.usecompatibletextrendering = true;         this.checkbox1.usevisualstylebackcolor = true;         //          // form1         //          this.clientsize = new system.drawing.size(292, 273);         this.controls.add(this.checkbox1);         this.controls.add(this.textbox1);         this.controls.add(this.button1);         this.name = "form1";         this.resumelayout(false);         this.performlayout();     }   } 

i coding rest of code myself. dont know how compile , add main exe?

the clue system.codedom.compiler think form1.cs contain no code (other initializecomponents call in constructor). if merge designer code simple string operations job easier.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -