Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > timer


Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2003, 10:04 PM
duny duny is offline
Freshman
 
Join Date: Apr 2003
Location: CA
Posts: 46
Question timer


Private Sub Timer1_Timer ()
Dim intCount As Integer
i want the start code here.
intCount = CInt(lblTime.Caption) ' Fetch the count

If IntCount = 0 Then
me.Timer1.Enabled = False ' Turn off the timer when done
' then the end code here
Exit Sub
End If
lblTime.Caption = CStr(intCount) - 1 ' decrement & save
End Sub


When the timer ends how do i reset the caption. I tried lbltimer.caption = "30"

But it did not work
__________________
http://max-c-univ.hopto.org/
Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem
Reply With Quote
  #2  
Old 04-13-2003, 10:07 PM
dianecandice's Avatar
dianecandice dianecandice is offline
Junior Contributor
 
Join Date: Mar 2003
Posts: 222
Default

the exit sub runs before you were able to set your label, try to do this:

Code:
Private Sub Timer1_Timer () Dim intCount As Integer i want the start code here. intCount = CInt(lblTime.Caption) ' Fetch the count If IntCount = 0 Then me.Timer1.Enabled = False ' Turn off the timer when done '***moved a copy to here, just before ending the procedure*** 'you can place whatever string you want for lblTime.Caption here lblTime.Caption = 30 '****************************************** ' then the end code here Exit Sub lblTime.Caption = CStr(intCount) - 1 ' decrement & save End If End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I initialise a Timer object (not Timer Control) mikey General 6 03-26-2003 09:29 AM
SendKeys to Desktop adamsr2 API 10 05-21-2002 08:07 PM
Question - With which VB version did the Timer (m) loquin General 4 02-20-2002 01:02 AM
Need help with timer, progress bar, access ... VBGestapo General 41 01-17-2002 01:28 AM
A note about timer control Defiance General 13 06-29-2001 06:42 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->