private void button2_Click(object sender, EventArgs e) { PredictShortTime predict = PredictShortTime.getPredictShortTime(); predict.Stop(); textBox1.Text = "stop\r\n"; }
/// <summary> /// 开始预测按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { PredictShortTime predict = PredictShortTime.getPredictShortTime(); predict.refreshtxt = (arg) => { this.Invoke(new Action(() => { textBox1.Text += arg + "\r\n"; })); }; predict.Start(); textBox1.Text = "start\r\n"; }