wpf c# button wait for a button press -
ok i'm begginer @ coding
so i'm trying button gonna wait for
user click on 1 of multiple other button continue
void mainbutton() { //the program run throw method //wait user choose 1 button (i made numeric pad buttons) //then use information work }
i know english isnt lot
try this:
bool gotresponse = false; //you need run maintask in different thread thread thread = new thread(new threadstart(dowork)); thread.start(); void dowork() { //do work //when else needed user popup message messagebox.show("say whatever need say"); while(!gotresponse) { //note: loop doesn't stop until gotresponse = true; } //do rest of work } private button_click(object sender, routedeventargs e) { gotresponse = true; }
Comments
Post a Comment