473,569 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

date and timer on a form

hi,

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 ?

thanks
Nov 20 '05 #1
3 1333
Hi,

Add a timer to your form. In the tick event update the textbox
text. Set the timers interval to 1000 and enabled to true.

Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s) Handles Timer1.Tick

TextBox1.Text = Now.ToShortTime String

End Sub

Ken

---------------------------

"aelhhattab i" <ae*********@ro gers.com> wrote in message
news:SN******** *******@news01. bloor.is.net.ca ble.rogers.com. ..
hi,

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 ?

thanks

Nov 20 '05 #2
Cor
Hi aelhhattabi

There is a greath timer example in the resource kit at GDI

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

You really will apriciate it seeing it,

But maybe a little bit disapointed about your own clock

:-(

Cor

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 ?

thanks

Nov 20 '05 #3
* "aelhhattab i" <ae*********@ro gers.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.Window s.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>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1850
by: rhaley | last post by:
ugh. Okay, I need to figure out the number of milliseconds between DateTime.Now and the end of the day so that I can make changes based on the date roll-over. I need to implement a Timer so that I can process things on the Timer.Elapsed event that would happen right at the date change (unless there is a better suggestion to implement an event...
13
7461
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the...
9
1392
by: Zach | last post by:
I would like to express the time with the time continually changing. I can get it to show once, but then it stays that way, using a loop jams. Is there a way to do this?
4
15367
by: Daniel Kaseman | last post by:
How do I convert a date into a serial number? (I'm trying to enter a FROM date and a TO date, then make my PROGRESS BAR show how close I am to the TO date.) get it? I know that MS Excel converts Dates into serial numbers, but I can't figure out how to do it with VB.Net. Please help, thanks.
10
17008
by: jerry.ranch | last post by:
I used =now() in a text box and that nicely displays date and time at the moment of opening How would I show updated data? I thought of an event procedure, but which one would I use since there really isn't any data choosing or mouse event associated with the date/time update Jerry
4
4623
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this program is like so: static void Main() {
11
2584
by: Hotrod2000 | last post by:
I'm quite new to programming but I'm having problems getting a timer to work in visual studio.net I've created a timer on a form, enabled it and then typed the following code (from the mdsn library as I thought this would be a good start!!!) but nothing happens :- Imports System.Timers
19
2113
lee123
by: lee123 | last post by:
how do i change this code to do dates instead if time: CurrentTime = Format(Time, "hh:mm") If CurrentTime = txtBillTime.Text Then Beep frmAppointment.WindowState = 0 'Restore form End If lee123
7
2224
by: wanwan | last post by:
Hi, I'm looking for a better way to do a date/time elapsed event rather than a timer elapsed event. Currently, I wrote my program to use a timer elapsed event set to 1 second, and it checks the date/time in the event. Is there a better way?
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.