using System; using System.Windows.Forms; using System.Drawing; class ex : Form { Label lb1 = new Label(); TextBox tb1 = new TextBox(); Button b1 = new Button(); ex() { Text = "hello"; lb1.Text = "example_label:"; b1.Text = "button"; b1.Click += new EventHandler(button_b1_click); tb1.Location = new Point(100, 0); b1.Location = new Point(200, 0); Controls.Add(lb1); Controls.Add(tb1); Controls.Add(b1); } void button_b1_click(object sender, EventArgs e) { tb1.Text = "example"; } static public void Main() { Application.Run(new ex()); } }