睡眠方式 [英] Sleep Method

查看:43
本文介绍了睡眠方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

 

受保护的 无效 Search_Click( 发件人 EventArgs e)

protected void Search_Click(object sender, EventArgs e)

{

Panel1.Visible =

Panel1.Visible =

;

true;

 

线程 .Sleep(10000);

Thread.Sleep(10000);

GridFill();

GridFill();

Panel1.Visible =

Panel1.Visible =

false ;

false;

}

上面的代码不起作用.该面板根本不可见.给我礼物

The Above code is not working. The Panel is not visible at all. Give me sugessions

推荐答案

 

您的代码:

 

您将面板可见性设置为true

You set the Panel visibility to true

然后线程休眠10秒(主线程),以使您的应用程序无响应

Then the Thread sleeps for 10 Seconds (The Mainthread) so your App is not Responding

此后,您将网格填充到主线程中(我认为这是一个长期运行的过程?),您的应用程序没有响应.

After this you fill the Grid in the Mainthread (i think its a long running process ?) yo your App is not responding.

 

然后将可见性设置为false.

Then you set the visibility to false.

 

最后一行代码是什么?

 


这篇关于睡眠方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆