返回首页

喜的朋友
我想在我的形式出现只是一瞬间的标签,所以它消失。
请指导我

回答

评论会员:游客 时间:2012/02/05
|lukeer:我想尝试删除通过计时器事件的控制:codeprelang="c#"spanclass="code-keyword"public/spanspanclass="code-keyword"class/spanParentingControl{System.Windows.Forms.LabelshortLivedLabel=spanclass="code-keyword"new/spanLabel();System.Windows.Forms.TimerlabelKiller=spanclass="code-keyword"new/spanTimer(); spanclass="code-keyword"override/spanspanclass="code-keyword"void/spanOnLoad(spanclass="code-keyword"object/spansender,EventArgse){shortLivedLabel.Location=spanclass="code-keyword"new/spanPoint(Whereveryouwantittobe);shortLivedLabel.Size=spanclass="code-keyword"new/spanSize(Whateversize);shortLivedLabel.Text=spanclass="code-string""/spanspanclass="code-string"Whatevertextthereshouldbe"/span; labelKiller.Interval=Howspanclass="code-keyword"long/spanyouwantittoexist.labelKiller.Tick+=spanclass="code-keyword"new/spanEventHandler(labelKiller_Tick); spanclass="code-keyword"this/span.Controls.Add(shortLivedLabel);labelKiller.Start();} spanclass="code-keyword"private/spanspanclass="code-keyword"void/spanlabelKiller_Tick(spanclass="code-keyword"object/spansender,EventArgse){labelKiller.Stop();spanclass="code-keyword"this/span.Controls.Remove(shortLivedLabel);}}/pre/code或者,如果你愿意,你可以显示()和隐藏()的标签,在适当的时候
Morgs摩根
评论会员:游客 时间:2012/02/05
一旦你的页面加载调用一个函数:-的setTimeout("$('#labelId"),隐藏();",1000);或-的setTimeout("document.getElementById("labelId)style.display='没有'。",1000);在这里看到:imgsrc=]
约翰・西蒙斯/取缔程序员
评论会员:游客 时间:2012/02/05
{C}当然,我会做一个计时器,一个主题,或BackgroundWorker对象,但上面的代码会做什么,我觉得它是你问的(在你的问题提供信息的数量)
乌玛・尚卡尔帕特尔:我认为,你说的是,Windows窗体
试试这个!希望它可以帮助
lblMsg.Text="Your Message";

for(int i=0;i<50000;i++);

lblMsg.Text="";