using System; using System.Drawing; using System.Windows.Forms; public class Form1 : Form { Button gomb = new Button(); public Form1() { gomb.Text = "Kattints ide"; gomb.Location = new Point(112, 50); gomb.Click += new EventHandler(Button_Click); Controls.Add(gomb); } static public void Main() { Application.Run(new Form1()); } private void Button_Click(object sender, EventArgs e) { MessageBox.Show("Gomb lenyomva"); } }