* "aelhhattabi" <ae*********@rogers.com> scripsit:
I'm new to vb.net . I have a problem waking up early. I usually miss my
morning classes. I downloaded some alarm clocks of the internet but most of
them are huge and have extra functionalities. so I decided to make my own
alarm clock. i created my project and made the form. I could display the
time on a textfield but I dont know how to make it increment like a clock
does. would anyone plz start me on the right track ?
Add a timer ('System.Windows.Forms.Timer') to your form, set its
'Interval' property to '500' (milliseconds), then doubleclick it to
create a handler for its 'Tick' event. There you can calculate the
difference between a starting date (for example, stored in a private
variable) with the current date/time ('DateTime.Now') and display it by
calling the resulting 'TimeSpan''s 'ToString' method.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>