SHOW:
|
|
- or go back to the newest paste.
| 1 | using System; | |
| 2 | using System.Windows.Forms; | |
| 3 | using System.Drawing; | |
| 4 | public class grafik | |
| 5 | {
| |
| 6 | - | Graphics g; |
| 6 | + | Graphics g; |
| 7 | - | void buatil() |
| 7 | + | Label l = new Label(); |
| 8 | - | {
|
| 8 | + | void buatil() |
| 9 | - | Form f = new Form(); |
| 9 | + | {
|
| 10 | - | Button b = new Button(); |
| 10 | + | Form f = new Form(); |
| 11 | - | Label l = new Label(); |
| 11 | + | Button a = new Button(); |
| 12 | - | b.Parent = f; |
| 12 | + | Button d = new Button(); |
| 13 | - | l.Text = "Gunnar"; |
| 13 | + | |
| 14 | - | l.Parent = f; |
| 14 | + | a.Parent = f; |
| 15 | - | f.Text = "Halló heimur form"; |
| 15 | + | d.Parent = f; |
| 16 | - | f.BackColor = Color.White; |
| 16 | + | l.Text = "Hit Points"; |
| 17 | - | f.Paint += new PaintEventHandler(this.innihald); |
| 17 | + | l.Parent = f; |
| 18 | - | b.Text = "SMELTTU!!"; |
| 18 | + | f.Text = "Halló heimur form"; |
| 19 | - | b.Location = new Point (20,100); |
| 19 | + | f.BackColor = Color.White; |
| 20 | - | b.Click += new EventHandler(this.smellt); |
| 20 | + | f.Paint += new PaintEventHandler(this.innihald); |
| 21 | - | Application.Run(f); |
| 21 | + | a.Text = "Attack"; |
| 22 | - | } |
| 22 | + | d.Text = "Defend"; |
| 23 | - | void innihald(object sender, PaintEventArgs p) |
| 23 | + | a.Location = new Point(20, 220); |
| 24 | - | {
|
| 24 | + | d.Location = new Point(100, 220); |
| 25 | - | g = p.Graphics; |
| 25 | + | a.Click += new EventHandler(this.smellt); |
| 26 | - | //g.DrawString("jæja...", new Font("Times New Roman", 12), Brushes.Blue, 0,0);
|
| 26 | + | Application.Run(f); |
| 27 | - | } |
| 27 | + | } |
| 28 | void innihald(object sender, PaintEventArgs p) | |
| 29 | - | void smellt(object o, EventArgs e) |
| 29 | + | {
|
| 30 | - | {
|
| 30 | + | g = p.Graphics; |
| 31 | - | Button b = (Button) o; |
| 31 | + | g.DrawString("jæja...", new Font("Times New Roman", 12), Brushes.Blue, 0, 0);
|
| 32 | - | b.Text = "Takk...."; |
| 32 | + | } |
| 33 | - | b.Click += new EventHandler(this.ut); |
| 33 | + | |
| 34 | - | Form.ActiveForm.Controls.l.Text = "Flott!"; |
| 34 | + | void smellt(object o, EventArgs e) |
| 35 | - | //g.DrawString("Flott!", new Font("Times New Roman", 12), Brushes.Blue, 0,0);
|
| 35 | + | {
|
| 36 | - | } |
| 36 | + | Button b = (Button)o; |
| 37 | - | void ut(object o, EventArgs e) |
| 37 | + | b.Click += new EventHandler(this.ut); |
| 38 | - | {
|
| 38 | + | l.Text = "Blabla"; |
| 39 | - | Form.ActiveForm.Close(); |
| 39 | + | } |
| 40 | - | } |
| 40 | + | void ut(object o, EventArgs e) |
| 41 | - | |
| 41 | + | {
|
| 42 | - | |
| 42 | + | Form.ActiveForm.Close(); |
| 43 | - | |
| 43 | + | } |
| 44 | - | static void Main() |
| 44 | + | |
| 45 | - | {
|
| 45 | + | static void Main() |
| 46 | - | new grafik().buatil(); |
| 46 | + | {
|
| 47 | - | } |
| 47 | + | new grafik().buatil(); |
| 48 | } | |
| 49 | } |