Displaying Digital and Analog Clock in VB.NET

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: clock design 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:
  1. Label2.Text = TimeOfDay 'we will display the digital time in our label
To display the digital clock when pressing the rbDigital radiobutton, have the code below:
  1.  If rbDigital.Checked = True Then
  2.             Timer1.Start() 'start the time
  3.             Label2.Show()
  4.             WebBrowser1.Hide()
  5.         Else
  6.             Label2.Hide()
  7.             WebBrowser1.Show()
  8.  
  9.         End If
To display the analog clock when pressing the rbAnalog radiobutton, have the code below:
  1.      If rbanalog.Checked = True Then
  2.             WebBrowser1.Show()
  3.  
  4.             Label2.Hide()
  5.         Else
  6.             WebBrowser1.Hide()
  7.             Label2.Show()
  8.  
  9.         End If
By default, we will have put rbDidital to be checked in loading the Form. Have this code:
  1.  rbDigital.Checked = True

Output:

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/BermzISware

Add new comment