How To wait in vb??

April 4, 2011 at 21:44:48
Specs: Windows 7
i need to know a command to wait, like i have two labels..... when the form is loaded i want label1 to come first and after 1 second -label2p

See More: How To wait in vb??

Report •

April 5, 2011 at 10:29:14
threre ıs a api named sleep. us ıt decıde how long you the program to waıt. thats ıt.

Report •

April 9, 2011 at 01:57:28
You could try using a Timer control, just set it to show the label and then disable itself (Otherwise it will keep ticking) I assume you mean VB.NET, but I am only REALLY good with VB6 - so I'll post VB6 code and you can try using it. Sometimes works fine anyway.

So you have a timer, just add the following code to it.

Label1.Visible = True
Timer1.Enabled = False


Label1.Caption = "CAPTION"
Timer1.Enabled = False

Use 2 timers for both labels and change the Interval to your desired MS

Report •

April 9, 2011 at 02:02:58
How you sleep depends on the VB in question.

How To Ask Questions The Smart Way

Report •

Related Solutions

April 9, 2011 at 02:03:29
Yeah, what Razor said.

Report •

April 9, 2011 at 04:29:04
Or you could use the Sleep API

Label1.Visible = True
Sleep 1000
Label2.Visible = True

Put the following function declaration in a .bas module and you can call the sleep function form anywhere in your application.

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Report •

Ask Question