using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 抽奖
{
public partial class Form1 : Form
{
public static int flag;
public static int[] content;
public static int w=0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
flag = int.Parse(textBox2.Text);
content = new int[flag];
for (int i = 0; i < content.Length; i++)
{
content[i] = i + 1;
}
timer1.Start();
timer1.Interval = 1;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (w==int.Parse(textBox2.Text))
{
w = 0;
}
textBox1.Text = content[w].ToString();
w++;
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}
}
}