在单一方法中,我如何(按顺序):
public void method()
{
picturebox1.visible = true;
//wait 2 seconds;
picturebox1.visible = false;
}
可能很容易回答,但我的脑筋现在已经炒了,抱歉。
答案 0 :(得分:0)
public async void method()
{
pictureBox1.Visible = true;
await Task.Delay(2000);
pictureBox1.Visible = false;
}
答案 1 :(得分:0)
public void method()
{
picturebox1.visible = true;
//wait 2 seconds;
Thread.Sleep(2000);
picturebox1.visible = false;
}