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

Member Avatar for AlanC

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.