Guest User

Untitled

a guest
Nov 14th, 2018
173
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace windowsform
  5. {
  6.     public partial class Form1 : Form
  7.     {
  8.         [STAThread]
  9.         public static void Main()
  10.         {
  11.             Application.EnableVisualStyles();
  12.             Application.Run(new Form1());
  13.  
  14.         }
  15.         public Button button1;
  16.         public Form1()
  17.         {
  18.             button1 = new Button();
  19.             button1.Size = new Size(40, 40);
  20.             button1.Location = new Point(30, 30);
  21.             button1.Text = "nyomj meg";
  22.             this.Controls.Add(button1);
  23.             button1.Click += new EventHandler(button1_Click);
  24.         }
  25.         private void button1_Click(object sender, EventArgs e)
  26.         {
  27.             MessageBox.Show("Helló világ!");
  28.         }
  29.     }
  30. }
RAW Paste Data