在vb.net中使用延迟 [英] using delay in vb.net
问题描述
朋友们,
我想知道怎样才能在vb.net中插入延迟
就像.....
i想要的在同一个标签上显示两个字符串
第一个字符串然后中断5秒然后第二个字符串
我怎么能实现这个?
i mean标签应该首先显示
label.text(之前)
然后它应该等待5秒然后它应该显示
标签.text(" After")
谢谢
Amit
" AmitTrehan" <是************ @ hotmail.com> schrieb嗨朋友们,
我想知道怎样才能在vb.net中插入延迟
就像.....
我想在两个字符串上显示相同的标签
第一个字符串然后中断5秒然后第二个字符串
我怎么能实现这个?
我的意思是标签应该首先显示
label.text(之前) )
那么它应该等待5秒然后它应该显示
label.text(After)
label.text = 之前
system.threading.thread.sleep(5000)
label.text =" after"
请注意,应用程序在5秒内被锁定。如果你不想要这个,你可以使用一个Timer(参见System.Windows.Forms.Timer)。在第一次设置
标签后,启用计时器(interval = 5000)。在Timer'的
Tick事件中,禁用计时器并再次设置标签文本。
-
Armin
http://www.plig.net/nnq/nquote。 html
http://www.netmeister.org /news/learn2quote.html
嗨Amit,
看看计时器,
有3个可以使用最简单的这个forms.form.timer
虽然如果你不介意你的表格免费你也可以做
在此消息中粗略写入
\\\
dim a as string()= {" Before"," ;中间,之后"}
for i as integer = 0 to a.lenght - 1
label1.text = a(i)
threading.thread.sleep(5000)
next
///
我希望这会有所帮助
Cor
我想知道如何在vb.net中插入延迟
就像......
第一个字符串然后断开5秒然后第二个字符串
我怎么能实现这个?
我的意思是标签应该先显示
label.text(" before")
然后它应该等待5秒然后它应该显示
label.text(" After")
嗨Armin,
我想我从我的解决方案获得Armin的评论,
为什么不呢?使用计时器?
你是在做同样的
:-)
Cor
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
"AmitTrehan" <am************@hotmail.com> schriebhi 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")
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
Hi Amit,
Have a look at timer,
there are 3 can use the most simple for this the forms.form.timer
Although if you do not mind that your form freze you can also do
Roughly written here in this message
\\\
dim a as string() = {"Before","Middle","After"}
for i as integer = 0 to a.lenght - 1
label1.text = a(i)
threading.thread.sleep(5000)
next
///
I hope this helps
Cor
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")
Hi Armin,
I think I get comments from Armin with my solution,
"Why not using a timer?
are you making the same
:-)
Cor
这篇关于在vb.net中使用延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!