472,107 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,107 software developers and data experts.

Display time in Label with constant update

14
Hi,

Me to Express vb 2k5
As I could remember there was a funtion in the old VB where simply type "Time" or something then it will show you the real time and second appear on the label.

Is that funtion still available in VB express 2k5, or it had been renamed to something else?

thx
Jan 17 '07 #1
8 17119
kenobewan
4,871 Expert 4TB
Have you tried something like:
Expand|Select|Wrap|Line Numbers
  1. lblTime.Text = Format(Now, "HH:mm:ss")
Hope that this helps.
Jan 17 '07 #2
Mulm3h
14
Have you tried something like:
Expand|Select|Wrap|Line Numbers
  1. lblTime.Text = Format(Now, "HH:mm:ss")
Hope that this helps.
i tried that before it does show the time, but it doesnt refresh like a realtime:(
Jan 17 '07 #3
kenobewan
4,871 Expert 4TB
Not sure purpose of clock, but live clocks are usually done through JS - check out:
Clocklink
Jan 17 '07 #4
Mulm3h
14
Not sure purpose of clock, but live clocks are usually done through JS - check out:
Clocklink
my idea behind using a clock with ticking second was for the user to know the current time when the program run all will be blackout only the program is visible so i need a clock for my VB project to let users know what time it is.
Jan 18 '07 #5
my idea behind using a clock with ticking second was for the user to know the current time when the program run all will be blackout only the program is visible so i need a clock for my VB project to let users know what time it is.
if your project is web application, you must use script ( javascript , or other ) to show current time.

if your project is window application, you can try by timer controls, place the code to tick event of timer control. set enabled to true and interval to 1000 for timer control's properties.
Jan 18 '07 #6
Well, I know this much.

In VB6, you can make a label showing the time and make it update by it self. In .NET I am still stumped on how to do that correctly.

but the Code for VB6 is

Expand|Select|Wrap|Line Numbers
  1. lbltime.caption = Time
  2.  
and it's that easy, I wish I knew how to do it in .NET, I'm sure my programming teacher will tell me what the code is, if I get it I will share it with everyone.

Till then,

Overdosed
Apr 1 '07 #7
Check out htis link:

http://www.mycsharpcorner.com/Post.aspx?postID=23

It shows how you can make your own Clock User Control, then you can use in your Windows Form.

The basic idea is simple: "you use a Timer object to refresh a Lable Text property with the current time".

Hope this helps!
Apr 1 '07 #8
I need a javascript to click an URL link at 7:00pm CST everyday which starts a web presentation?
May 23 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Agency | last post: by
3 posts views Thread by Terry Carroll | last post: by
10 posts views Thread by Bart Goeman | last post: by
3 posts views Thread by Will | last post: by
5 posts views Thread by Rex Mottram | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.