好吧,我是编码初学者
所以我想做的是按钮谁会等待
用户单击多个其他按钮之一以继续
void Mainbutton()
{
//the program run throw so method
//Wait for the user to choose one button (I made a numeric pad with buttons)
//Then use this information to work
}
我知道我的英语不太好
多谢
尝试这样的事情:
bool gotResponse = false;
//you need to run MainTask in a different thread
Thread thread = new Thread(new ThreadStart(DoWork));
thread.Start();
void DoWork()
{
//do some work
//when something else needed from user then popup message
MessageBox.Show("say whatever you need to say");
while(!gotResponse)
{
//note: this loop doesn't stop until gotResponse = true;
}
//do rest of your work
}
private button_Click(object sender, RoutedEventArgs e)
{
gotResponse = true;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)