public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
}
bool flag = false;
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThreadStart(GetNum));
th.Start();
if (button1.Text == "开始抽奖")
{
flag = true;
button1.Text = "停止抽奖";
}
else if (button1.Text == "停止抽奖")
{
flag = false;
button1.Text = "开始抽奖";