954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Displaying time on a Form

Hey all~ I'm very new to VB.net infact i've only been so far through 2 classes but I'm still going. My personal Project that I'm doing is a simply display with some buttons that when you click on them that link to an exe file on my desktop. I've gotten that part down, but i'm having trouble locating code to add/Display time on my form.. I want it to display Vertical with the format of HH:MM:SS | MM/DD/YYYY. I want it to be in sync with my system time. Is there any way possibal of doing that? ^^; Thanks in advance for any help.:mrgreen:

Arrow203
Newbie Poster
4 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Have you tried the date() class?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

You need to add a Timer to you form and a Lable

Double click in the timer and it should up the code editor in the Timer Tick event.

In the Tick event you need to update the Lable.

Lable.text = Date.Now or there abouts..

Make sure the timer interval is set to 1 second, (timer is in milli seconds to it will be 1000)

Stick to it and all this will make sense soon.

JAPEL

japelweb
Newbie Poster
6 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You