using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace doevent
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i <=10000000; i++)
{
label1.Text = i.ToString();
}
}
}
}
------解决方案-------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace doevent { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i <=10000000; i++) { label1.Text = i.ToString(); Application.DoEvents(); } } } }
------解决方案-------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
using System.Threading;
namespace doevent { public partial class Form1 : Form { public Form1() { InitializeComponent(); }