Putting the current time 
Author Message
 Putting the current time

I want to put the time (hours, minutes and seconds) in a VB4 program. I
tried this:
label1.caption=time$

and this:

Private Sub From1_MouseMove()
label1.caption=time$
End Sub

In the first example,  the time doesn't refresh automatically, and in
the second the time only is refreshed when the mouse moves across the
form (...)

I want to know how to put a time label that changes the seconds
automatically

Thanx!!!



Tue, 18 Apr 2000 03:00:00 GMT  
 Putting the current time

Quote:

>I want to put the time (hours, minutes and seconds) in a VB4 program. I
>tried this:
>label1.caption=time$

>and this:

>Private Sub From1_MouseMove()
>label1.caption=time$
>End Sub

>In the first example,  the time doesn't refresh automatically, and in
>the second the time only is refreshed when the mouse moves across the
>form (...)

>I want to know how to put a time label that changes the seconds
>automatically

>Thanx!!!

        Use the Timer control, with the interval set to 1000 (i.e., one second).
Then, in the Timer1 event, refresh the label.

                  :)  Pirate Pete the Christian Privateer  :)
                  :)             aka Jack Voltz            :)
                  :)      M  A  R  A  N  A  T  H  A  !     :)


                  Web page:  http://www.ovnet.com/~voltz
              Prolife page:  http://www.ovnet.com/~voltz/prolife.htm
                     Music: http://www.ovnet.com/~voltz/music.htm



Tue, 18 Apr 2000 03:00:00 GMT  
 Putting the current time

          Use the Timer control, with the interval set to 1000 (i.e., one second).

Quote:
> Then, in the Timer1 event, refresh the label.

I would complement that suggestion by including a statusbar control with one of the
panels set to: sbrTime.  Then refresh the statusbar panel every second (by setting
the timer interval to 1000)....

minor point....

===========================================
Dave Mosher
Information Technology Director
DEKA Research and Development Corp.

Visual Basic Instructor
Daniel Webster College



Fri, 21 Apr 2000 03:00:00 GMT  
 Putting the current time

If you want the time to update every second, minute, or whatever, you will
need to set a Timer control to fire off at that interval and then issue you
command from the timer event.

--

Ross Products Division - Abbott Laboratories



Quote:
> I want to put the time (hours, minutes and seconds) in a VB4 program. I
> tried this:
> label1.caption=time$

> and this:

> Private Sub From1_MouseMove()
> label1.caption=time$
> End Sub

> In the first example,  the time doesn't refresh automatically, and in
> the second the time only is refreshed when the mouse moves across the
> form (...)

> I want to know how to put a time label that changes the seconds
> automatically



Tue, 25 Apr 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Displaying the Current Date and Current Time

2. Run Time vs Design Time - No Current Record

3. Formatting Time to GMT when current Time Zone not known

4. Current-time Runing-time in label.

5. Current-time Runing-time in label.

6. put current date in a variable

7. Can't put current date in an SQL INSERT

8. Putting Current month in a variable

9. Putting a Dat file in the current Directory

10. Framework DL time - Will it put off users?

11. Putting date and time in text box ...Should be simple

12. VB5, How to put text in the systemtray (like the time)

 

 
Powered by phpBB® Forum Software