timer countdown help

Reply

Join Date: Dec 2005
Posts: 11
Reputation: solway is an unknown quantity at this point 
Solved Threads: 0
solway solway is offline Offline
Newbie Poster

timer countdown help

 
0
  #1
Dec 15th, 2005
hi all, ive just started learning VB6 and have come across a problem or two. can you guys help.

i am trying to create a countdown timer, i have made one with a timer and textboxs (5 textboxs, mmm:ss).
but i have seen some examples using pictures as the numbers. wondered how you would do this?
P.S, i am using a Resource File to store all pictures, so its all included into the exe.

another question is, how would i enable a button soon the timer reaches 004:00 (4 mins). is there a way to do with with numbers and pictures(as numbers, from the above question)?

finding is hard to explain, please post if you don't know what im on about. :mrgreen:

regards
solway
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 31
Reputation: AlanC is an unknown quantity at this point 
Solved Threads: 1
AlanC's Avatar
AlanC AlanC is offline Offline
Light Poster

Re: timer countdown help

 
0
  #2
Dec 22nd, 2005
Hi

You could have a series of picture controls (or image controls), and load pictures into them using the load picture method. For each digit, (having done the maths to get separate variables for each one) you could use Select Case to load the pictures:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Select case nTensMinutes
  2. case 0
  3. picture1.picture = loadpicture ("zero.gif")
  4. case 1
  5. picture1.picture = loadpicture ("one.gif")
  6. '
  7. '
  8. '
  9. '
  10.  
  11. End Select

I'm not sure about the resource control implementation.

As for your button, on the form load event disable it:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Command1.Enabled=false
  3. ' etc
  4. ' etc

then, when your minutes variable gets to 4,

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. If nMinutes = 4 then
  2. command1.enabled = true
  3. End If

Hope this helps, have a good Christmas
AlanC
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 11
Reputation: solway is an unknown quantity at this point 
Solved Threads: 0
solway solway is offline Offline
Newbie Poster

Re: timer countdown help

 
0
  #3
Dec 22nd, 2005
thanks for the help, well the way i done it, was properly the long way round.

a normal count down timer using textboxs. then a resource file loaded with pictures. and telling it to change to a certain picture in a picturebox, soon the timer reaches a certain number.

thanks for the alarm code bit (end code on the post), i couldn't figure that one out.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC