Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 1:31 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ]  Bookmark and Share
Author Message
 Post subject: Timer code help please!
PostPosted: Thu Mar 05, 2009 8:39 pm 
Offline

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
 Profile  
 
 Post subject: Re: Timer code help please!
PostPosted: Mon Mar 09, 2009 2:07 am 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley