Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing image on timer - Clock

Status
Not open for further replies.

bigkeith

IS-IT--Management
Jul 27, 2001
36
GB
Hiya,
I'm trying to create a clock that is displayed on a form in hh:mm:ss format. What I would like to do is instead of using one of the fonts to display the time I'd like to show bitmaps that correspond to the correct digit. I have no problem in getting the required digit using the MID command against the results of the NOW command and assigning it to a variable. What I have also done is import my graphics into 10 hidden images and named them img0....img9. What I'm stuck with is assigning the .picture property of each of the displayed digits to the corresponding 'hidden' image. I've tried various ways of doing this eg.

imgHH1.picture = "img" & varhh1.picture - which I hoped would give me imgHH1.picture = img1.picture (1 being the current hour)

I've also tried concatonating the "img" and the var eg.

HH1 = "img" & varhh1
imghh1.picture = hh1.picture - Again doesn't work.

Could anyone please point me in the right direction with this. I imagine I cannot use variables when I assign properties.

Thanks in advance

Keith
 
I do not see where the control name is "qualified".

Something like Me.("img" & varhh1.picture) would at least be recognized as a reference to an object (Control) within an object (Form). This approach ASSUMES the code in in the form module. To do much the same in a general module, you would need to pass a reference to the FORM to the procedure.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks MichaelRed,
Fom your guidance, I came up with the following

imghh1.Picture = Me("img" & varhh1).Picture

This works a treat, and my new clock looks great.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top