Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 11th, 2008, 3:03 PM   #1
Syntax_Error
Programmer
 
Syntax_Error's Avatar
 
Join Date: Jan 2008
Posts: 9
Rep Power: 0 Syntax_Error is on a distinguished road
Visual Basic Current Time On Form

How do I show the current time on the form in a label, and update it every second or maybe every minute???

I put "lblTime.Text = DateTime.Now" into a OnClick sub, but that only works when I click it... how do I get it to change every few seconds, or minute?????

also How can I at the same time on another label make a timer that counts up continuously from when the application loads?

thanks

-S_E
Syntax_Error is offline   Reply With Quote
Old Feb 11th, 2008, 3:22 PM   #2
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 288
Rep Power: 3 Ghost is on a distinguished road
Re: Visual Basic Current Time On Form

lblTime.Text = DateTime.Now.Minute.ToString()

Your best bet is use a timer to tick every minute and run that little bit of code.
Ghost is offline   Reply With Quote
Old Feb 11th, 2008, 4:05 PM   #3
Syntax_Error
Programmer
 
Syntax_Error's Avatar
 
Join Date: Jan 2008
Posts: 9
Rep Power: 0 Syntax_Error is on a distinguished road
Re: Visual Basic Current Time On Form

ok, I guess I forgot to mention this. I'm a VB newbie.

This would be done how?
Syntax_Error is offline   Reply With Quote
Old Feb 29th, 2008, 8:06 PM   #4
Skezid
Code Poet
 
Skezid's Avatar
 
Join Date: Feb 2008
Location: Sydney, Nova Scotia (Canada)
Posts: 5
Rep Power: 0 Skezid is on a distinguished road
Re: Visual Basic Current Time On Form

There is a timer object you can add to the form, it should be a little stop watch-like looking icon on the tools side bar. After adding it, set the interval to the number of miliseconds you want the timer to iterate itself (in this case, 1000 for one second, or 60000 for a minute).

The code you want executed goes inside of the timer itself.
Skezid is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic to java HELP! araujo2nd Visual Basic .NET 1 Feb 13th, 2008 9:36 AM
Visual Basic Admin Input kewlgeye Visual Basic 0 Jan 23rd, 2008 11:14 AM
visual basic pixel image comparison youngnoviceinneedofhelp Visual Basic 3 Mar 19th, 2006 1:57 PM
Visual Basic 6.0 Form Effects fox123 Visual Basic 7 Dec 21st, 2005 7:03 AM
Enquiry About Visual Basic Project kbkhoo5053 Visual Basic 13 Feb 15th, 2005 2:20 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:47 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC