Making A Clock In Visual Basic

Опубликовано: 09 Июнь 2025
на канале: marblestech
292
1

Making a simple clock in visual basic 2010,
components needed are :
-One Button
-One Label
-One Timer

Code :
Timer Code :
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeOfDay

End Sub

Button Code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If Me.Width = 425 Then
Me.Width = 295

Else
Me.Width = 425
End If

If Button1.Text = "Add Secconds" Then
Button1.Text = "Take Secconds"
Else
Button1.Text = "Add Secconds"
End If

End Sub