Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace ClickTheBox
- {
- public partial class X : Form
- {
- int score;
- public X()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- Left = 0;
- Top = 0;
- Width = Screen.PrimaryScreen.WorkingArea.Width;
- Height = Screen.PrimaryScreen.WorkingArea.Height;
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void label1_Click_1(object sender, EventArgs e)
- {
- timer1.Interval -= 50;
- score += 1;
- label2.Text = score.ToString();
- }
- private void label1_Click_2(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- Random r = new Random();
- Box.Left = r.Next(0, Width);
- Box.Top = r.Next(0, Height);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- timer1.Interval = 1000;
- label2.Text = "0";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement