-5

OK、私はコーディングの初心者です

だから私がやろうとしているのは
、ユーザーが他の複数のボタンの1つをクリックして続行するのを待つボタンです

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

}

私は私の英語がそれほど上手ではないことを知っています どうもありがとう

4

1 に答える 1

-1

次のようなことを試してください:

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;
}
于 2013-04-08T21:07:02.410 に答える