Code Required <p>I Have this code in my Project and I want to Increase this Number GRADUALLY with DELAY 1 Sec in Label1 so plz tell me what can I do.</p> <p>Private Sub Command1_Click()</p> <p>Dim S As Integer<br/>For S = 1 To 100<br/>Label1.Caption = S<br/>Next</p> <p>End Sub</p>© 2009 Microsoft Corporation. All rights reserved.Thu, 25 Jun 2009 03:08:52 Z76c65990-81fe-41e5-b2c2-7cfb55d5190bhttp://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#76c65990-81fe-41e5-b2c2-7cfb55d5190bhttp://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#76c65990-81fe-41e5-b2c2-7cfb55d5190bSHUJA ABBAShttp://social.msdn.microsoft.com/Profile/en-US/?user=SHUJA%20ABBASCode Required <p>I Have this code in my Project and I want to Increase this Number GRADUALLY with DELAY 1 Sec in Label1 so plz tell me what can I do.</p> <p>Private Sub Command1_Click()</p> <p>Dim S As Integer<br/>For S = 1 To 100<br/>Label1.Caption = S<br/>Next</p> <p>End Sub</p>Thu, 18 Jun 2009 12:12:45 Z2009-06-18T12:12:45Zhttp://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#d924b5af-f06e-4d3c-98d0-ababeea566dfhttp://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#d924b5af-f06e-4d3c-98d0-ababeea566dfRong-Chun Zhanghttp://social.msdn.microsoft.com/Profile/en-US/?user=Rong-Chun%20ZhangCode Required <p>Hello ,<br/><br/>You need to call Thread.Sleep method to force the current thread to block for one second. If you working with Windows Form Application, please try something like the following <br/><br/>    Delegate Sub SetText(ByVal txt As String)</p> <p><br/>    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br/>        Dim t As New Thread(New ThreadStart(AddressOf InvokeMethod))<br/>        t.Start()<br/>    End Sub</p> <p>    Private Sub IncrementalText(ByVal txt As String)<br/>        If Me.Label1.InvokeRequired Then<br/>            Dim pro As New SetText(AddressOf IncrementalText)<br/>            Me.Invoke(pro, New Object() {txt})<br/>        Else<br/>            Me.Label1.Text = txt<br/>        End If<br/>    End Sub</p> <p>    Private Sub InvokeMethod()<br/>        For i As Integer = 1 To 100<br/>            Thread.Sleep(1000)<br/>            IncrementalText(i.ToString())<br/>        Next<br/>    End Sub<br/><br/>More information,<br/><a href="http://msdn.microsoft.com/en-us/library/ms171728.aspx">http://msdn.microsoft.com/en-us/library/ms171728.aspx</a><br/><br/>Since this forum is for Visual SourceSafe, questions about VB.NET, please ask on VB.NET forum.<br/><a href="http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads">http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads</a><br/><br/>Thanks,<br/>Rong-Chun Zhang</p><hr class="sig">Please mark the replies as answers if they help and unmark if they don't.<br/> <a href="http://cfx.codeplex.com/">Welcome to the All-In-One Code Framework</a>, a sample code project owned by the MSDN Forum Support team!Mon, 22 Jun 2009 11:05:04 Z2009-06-22T11:05:04Zhttp://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#c00b2508-4d00-4389-a10f-b1fdf7cfd072http://social.msdn.microsoft.com/Forums/en/vssourcecontrol/thread/76c65990-81fe-41e5-b2c2-7cfb55d5190b#c00b2508-4d00-4389-a10f-b1fdf7cfd072Catherine Seahttp://social.msdn.microsoft.com/Profile/en-US/?user=Catherine%20SeaCode Required <p>Thanks for the code, Rong-Chun.<br/><br/>Catherine Sea<br/><a href="http://www.scmsoftwareconfigurationmanagement.com">http://www.scmsoftwareconfigurationmanagement.com</a></p>Thu, 25 Jun 2009 03:08:52 Z2009-06-25T03:08:52Z