Thursday, March 8, 2012

Creating a clock in VB2010

Creating a clock in VB2010 is pretty easy. First of all you need to insert a timer control into your form and set its interval to 1000, which is equivalent to 1 second. Next, insert a label, clear its text and set an appropriate size(you need to disable autosize).

Now click on the timer and key in the following code:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Execute the code and you have your clock up and running.

My name is Liew Voon Kiong. I hold a Bachelor Degree in Mathematics, a Master Degree in Management and a Doctoral Degree in Business Administration. I obtained the DBA degree from University of South Australia.I have been involved in programming for more than 15 years. I created this popular online Visual Basic Tutorial in 1996 and since then the web site has attracted millions of visitors .It is the top ranked Visual Basic tutorial website in many search engines including Google. I have also written a few Visual Basic related books. One of the books, Visual Basic 6 Made Easy was published by BookSurge LLC, an Amazon.com publisher. The rest are ebooks. Learn more about the author at helium.com

View the original article here

No comments:

Post a Comment