首先在窗体上有 lable1,//运行显示 button1,//开始 button2,//暂停和继续 button3//停止 窗体上还放Timer控件timer1 代码实现如下, using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace testMain { public partial class Form1 : Form { public enum RunState { running, pause, stop } private int i = 0; RunState state = RunState.stop; public Form1() { InitializeComponent(); } private void RunProc(object sender,EventArgs e)//执行的部分 { timer1.Enabled = false; if (state == RunState.running)