![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Sep 2004
Posts: 50
Rep Power: 5
![]() |
I want to be able to put a continuing date and time text on an application.
I can use this fuction: Format(Now, "f"), which outputs: Monday, June 04, 2007 12:12PM ,but once the date and time is shown, it will stay the same forever... I guess It would need to work with a timer or something, but can somebody please give me some help on this? Thanks in advance! |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Just throw it in a timer_tick event. Set its enabled property to true, and have it update every second.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: May 2006
Posts: 51
Rep Power: 3
![]() |
yeh as Booze said.. add a timer to you application. set its event to whatever the code is to update your clock.. and enable it to update every 100 (thats in millisecs)
__________________
AMD Athlon X2 4200+ -- Asus V3-M2V890 -- 2GB Kingston -- Vista Ultimate 32bit + Ubuntu 8.04 Intel C2D T5870 2.0GHZ -- Vostro 1510 -- 2048MB -- Windows XP SP2 ASCII stupid question, get a stupid ANSI ! |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
Yeh 100 milliseconds should be OK for you! Are you OK with the exact syntax? What you wrote looked good.
|
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
I have not done anything in VB.NET for a while but does an Timer object not need to be started explicitly rather than simply enabled? - Im sure it does, so enabling an instance in your application will be a little disappointing.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles.. |
|
|
|
|
|
#6 |
|
Programmer
|
Very simple example to show what i think you want. Make a form, with a label, and two buttons, IF you click the first button starts the timer ( <timername>.start() ), second button ( <timername.stop> ). The rest you should be able to get from the code below.
vb Syntax (Toggle Plain Text)
The attached is a all the files from my little test project, made in VS2005 SP1. |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
|
Yep but make sure you drag it from the toolbox first!
|
|
|
|
![]() |
| 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 |
| Date and Time on HTML Form | Druid | PHP | 3 | Apr 19th, 2007 6:43 PM |
| Date Routine | tbohon | Perl | 2 | Jan 15th, 2007 12:14 PM |
| date() Question | grimpirate | PHP | 2 | Nov 5th, 2006 7:58 PM |
| using Text fields in SWT | elford | Java | 4 | Dec 27th, 2005 1:38 PM |
| Time between two dates and times | Illuminati | Visual Basic .NET | 4 | Apr 10th, 2005 9:33 PM |