954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

timer countdown help

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

solway
Newbie Poster
11 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

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:

Select case nTensMinutes
   case 0
      picture1.picture = loadpicture ("zero.gif")
   case 1
      picture1.picture = loadpicture ("one.gif")
   '
   '
   '
   '

End Select


I'm not sure about the resource control implementation.

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

Private Sub Form_Load()
   Command1.Enabled=false
   ' etc
   ' etc


then, when your minutes variable gets to 4,

If nMinutes = 4 then
   command1.enabled = true
End If


Hope this helps, have a good Christmas
AlanC

AlanC
Light Poster
31 posts since Jul 2005
Reputation Points: 13
Solved Threads: 1
 

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.

solway
Newbie Poster
11 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You