问题描述
朋友们,
我想知道怎样才能在vb.net中插入延迟
就像.....
i想要的在同一个标签上显示两个字符串
第一个字符串然后中断5秒然后第二个字符串
我怎么能实现这个?
i mean标签应该首先显示
label.text(之前)
然后它应该等待5秒然后它应该显示
标签.text(" After")
谢谢
Amit
label.text = 之前
system.threading.thread.sleep(5000)
label.text =" after"
请注意,应用程序在5秒内被锁定。如果你不想要这个,你可以使用一个Timer(参见System.Windows.Forms.Timer)。在第一次设置
标签后,启用计时器(interval = 5000)。在Timer'的
Tick事件中,禁用计时器并再次设置标签文本。
-
Armin
hi friends,
I want to know how can we insert delay in vb.net
like.....
i want to show two strings on same label
first one string then break of 5 secs and then second string
how can i acheive this?
i mean label should show first
label.text("before")
then it should wait for 5 secs and then it should show
label.text("After")
thanks
Amit
label.text = "before"
system.threading.thread.sleep(5000)
label.text = "after"
Note that the app is locked during the 5 sec. If you don''t want this, you
can use a Timer (see System.Windows.Forms.Timer) instead. After setting the
label the first time, enable the timer (interval = 5000). In the Timer''s
Tick event, disable the timer and set the label text again.
--
Armin
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
这篇关于在vb.net中使用延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!