Sunday, September 2, 2012

Hello World 2 (C#)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Created by SharpDevelop.
 * User: wai
 * Date: 2/9/2012
 * Time: 15:34
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace HelloWorld
{
 public partial class MainForm : Form
 {
  public MainForm()
  {
   InitializeComponent();
   
   this.Size = new Size(220, 150);
   
   Button button = new Button();
   button.Name = "Button01";
   button.Text = "Hi";
   button.Location = new Point(0,0);
   button.Size = new Size(100, 40);
   button.Click += new EventHandler(Click);
   this.Controls.Add(button);
  }
  
  private void Click(object sender, EventArgs e)
  {
     MessageBox.Show("Wow", "Message");
  }
 }
}



No comments:

Post a Comment