Displaying Digital and Analog Clock in VB.NET
Submitted by donbermoy on Monday, April 6, 2015 - 23:43.
Today, I will teach you how to create and display the digital and analog time.
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add two radioButtons named rbDigital and rbanalog. Insert also a timer named Timer1, add a label named Label2, and a webbrowser named WebBrowser1. You must design your interface like this:
Note: Put this site in the URL property of your webbrowser so that we can have the analog clock. - http://www.gheos.net/js/clock/clock.swf
3. For the coding:
To get the digital time, we will code for the ticking of our Timer:
To display the digital clock when pressing the rbDigital radiobutton, have the code below:
To display the analog clock when pressing the rbAnalog radiobutton, have the code below:
By default, we will have put rbDidital to be checked in loading the Form. Have this code:
- Label2.Text = TimeOfDay 'we will display the digital time in our label
- If rbDigital.Checked = True Then
- Timer1.Start() 'start the time
- Label2.Show()
- WebBrowser1.Hide()
- Else
- Label2.Hide()
- WebBrowser1.Show()
- End If
- If rbanalog.Checked = True Then
- WebBrowser1.Show()
- Label2.Hide()
- Else
- WebBrowser1.Hide()
- Label2.Show()
- End If
- rbDigital.Checked = True
Output:
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards, Engr. Lyndon Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISwareAdd new comment
- 5068 views