![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jan 2008
Posts: 9
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 288
Rep Power: 3
![]() |
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. |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jan 2008
Posts: 9
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#4 |
|
Code Poet
Join Date: Feb 2008
Location: Sydney, Nova Scotia (Canada)
Posts: 5
Rep Power: 0
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |