|
-
Jun 19th, 2004, 10:50 AM
#1
Thread Starter
Member
Pausing the sequence
Hi,
Is it possible to make vb.net 'pause' for a few seconds before carrying on through the code. For example,
on button click
label1.text = "Hello"
**Code here to pause for 2 seconds then...**
label1.text = "This is my first post"
**Code here to pause for 2 seconds then...**
label1.text = "I dont know what I'm doing"
etc etc
any help on this would be great. I am quite new to this as you can tell.
thanks a lot.
-
Jun 19th, 2004, 11:54 AM
#2
Sleep mode
Try this
VB Code:
label1.text = "Hello"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "This is my first post"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "I dont know what I'm doing"
-
Jun 19th, 2004, 01:16 PM
#3
Thread Starter
Member
hi, thanks for your help
i have tried this and it seems to just make everything wait for 2 seconds and then just posts the last label1.text
for example
label1.text = "Hello"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "This is my first post"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "I dont know what I'm doing"
just waits a few seconds and then posts "I dont know what im doing" - i never get to see either "Hello" or "This is my first post"
any ideas?!
-
Jun 19th, 2004, 07:19 PM
#4
PowerPoster
Originally posted by grandad
hi, thanks for your help
i have tried this and it seems to just make everything wait for 2 seconds and then just posts the last label1.text
for example
label1.text = "Hello"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "This is my first post"
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "I dont know what I'm doing"
just waits a few seconds and then posts "I dont know what im doing" - i never get to see either "Hello" or "This is my first post"
any ideas?!
The label needs updating each time. Try
VB Code:
Label1.Text = "Hello"
Label1.Update()
Threading.Thread.Sleep(2000) ' 2 seconds delay
Label1.Text = "This is my first post"
Label1.Update()
Threading.Thread.Sleep(2000) ' 2 seconds delay
label1.text = "I dont know what I'm doing"
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jun 20th, 2004, 05:09 AM
#5
Thread Starter
Member
Excelent, that works. Thanks very much.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|