日期:2014-05-17 浏览次数:20854 次
namespace ThreadDemo { public partial class Form1 : Form { bool Init = false; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Thread getpara = new Thread(GetPara); Init = false; getpara.Start(); } //Get必须调用Show private void GetPara() { Show(); Init = true; } //如果调用Show一定会触发Change事件 private void Show() { Thread change = new Thread(Change); change.Start(new object()); } //此处是一事件 可以在界面上触发 private void Change() { if (Init == false) return; Thread setpara = new Thread(SetPara); setpara.Start(); } private void SetPara() { ;//Set Para } } }