Hi,
If I understand you, you want to create a Windows Form without the Visual Studio Designer. You can:
public class Form1 : Form
{
Button button1;
void InitializeComponent()
{
button1 = new Button();
this.SuspendLayout();
button1.Name = "button1";
button1.Text = "Button 1";
button1.Size = new Size(250, 150);
button.Location = new Point(100, 100);
button1.Click += button1_Click;
this.Controls.Add(button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
public Form1()
{
InitializeComponent();
}
void button1_Click(object sender, EventArgs e)
{
}
}
Quote:
Actually I am creating a custom C# compiler
Important additional information: if you want to compile a Windows Forms application, don't forget to add a reference to "System.Drawing.dll" and to "System.Windows.Forms.dll"
Hope this helps.