|
Your time now: Mon Nov 23, 2009 1:31 pm
|
View unanswered posts | View active topics
| Author |
Message |
|
El Don
|
Post subject: Timer code help please! Posted: Thu Mar 05, 2009 8:39 pm |
|
Joined: Thu Mar 05, 2009 8:21 pm Posts: 2
|
|
I'm trying to program a countdown timer that shows the time in a label, with a button to start it, and if the button is pressed again add certain amount of time, for example 1 minute. Can anyone help me please? I need it for my biology class.
|
|
| Top |
|
 |
|
White95dp
|
Post subject: Re: Timer code help please! Posted: Mon Mar 09, 2009 2:07 am |
|
Joined: Mon Mar 09, 2009 1:52 am Posts: 7
|
|
Dim iClock As Integer
Private Sub Command1_Click() If Timer1.Enabled Then iClock = iClock + 60 Else Timer1.Enabled = True Label1.Caption = "0:00" End If End Sub
Private Sub Form_Load() iClock = 0 Timer1.Interval = 1000 Timer1.Enabled = False End Sub
Private Sub Timer1_Timer() Dim iMin As Integer Dim iSec As Integer iClock = iClock + 1 iMin = Int(iClock / 60) iSec = iClock - iMin * 60 Label1.Caption = iMin & ":" & Format(iSec, "00") End Sub
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
|