在C#中显示标签一会儿 [英] Show a label for a moment in C#

查看:85
本文介绍了在C#中显示标签一会儿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友
我希望在表单中显示标签仅一会儿,然后消失.
请指导我

hi friends
i want in my form appear a label for just a moment so disappear it.
please guide me

推荐答案

页面加载后,请调用以下函数:

-setTimeout("
Once your page loads call a function to:

- setTimeout("


("#labelId).hide();",1000);

-setTimeout("document.getElementById(" labelId).style.display =" none;",1000);

看到这里:

http://www.w3schools.com/js/js_timing.asp [
(''#labelId'').hide();", 1000);
or
- setTimeout("document.getElementById(''labelId'').style.display=''none'';", 1000);

see here:

http://www.w3schools.com/js/js_timing.asp[^]


label1.Visible = true;
Thread.Sleep(500);
label1.Visible = false;


当然,我可以使用TimerThreadBackgroundWorker对象来执行此操作,但是上面的代码将完全按照我认为的要求(鉴于所提供的信息量)在您的问题中).


Of course, I would do this with a Timer, a Thread, or a BackgroundWorker object, but the code above will do exactly what I think it is that you''re asking (given the amount of info provided in your question).


这篇关于在C#中显示标签一会儿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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