|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
My Threading Timer Doesn't FireI've tried using java, I've tried using the system timer - this is my last hope - please help! Here's my Code ----------------- Private strConn As String = ConfigurationSettings.AppSettings("conString") Private Sub btnAgree_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAgree.Click Dim oCallback As New TimerCallback(AddressOf OnTick) Dim lPeriod As Long = 6000 Try oTimer = New System.Threading.Timer(oCallback, Nothing, 0, lPeriod) Catch ex As Exception Response.Write("It Didn't Work") End Try pnl4.Enabled = True pnl4.Visible = True pnl9.Enabled = False pnl9.Visible = False Private Sub OnTick(ByVal state As Object) pnl4.Visible = False pnl9.Enabled = True pnl9.Visible = True End Sub -------------------------------- From: Daniel Maycock ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/) <Id>MMswZETqaEGmnOTUwMNnOA==</Id> Daniel Maycock via .NET 247 <anonym***@dotnet247.com> wrote in
news:ujSYL68MFHA.568@TK2MSFTNGP09.phx.gbl: In VB.NET> Try > oTimer = New System.Threading.Timer(oCallback, Nothing, 0,lPeriod) > > Catch ex As Exception > Response.Write("It Didn't Work") > End Try > First define oTimer outside the Try block since its scoped, second lPeriod is in the wrong position, it should be (oCallback,Nothing,lPeriod,0) if your intention is to delay the client for 6 sec before moving on. Hope this helps, MP 'adipex' (http://adipex-hgf65.blogspot.com/)
http://adipex-hgf65.blogspot.com/
See you. -- Rodintino ------------------------------------------------------------------------ Rodintino's Profile: http://www.hightechtalks.com/m827 View this thread: http://www.hightechtalks.com/t323539 |
|||||||||||||||||||||||