04-19-2011, 04:54 PM
Here's my submission anyway:
Direct Download:
http://download789.mediafire.com/9mmf76q.../Timer.exe
Code:
Public Class Form1
'Started defining the values for the numbers as strings right off the bat so I can reference them anywhere in the code inside of the Public class for form 1..
Dim a As String
Dim b As String
Dim c As String
Dim x As String
Dim y As String
Dim z As String
Dim h As String
Dim m As String
Dim s As String
Dim u As String
Dim v As String
'On form load (when app starts) display the 0's
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
a = "0"
b = "0"
c = "0"
x = "0"
y = "0"
z = "0"
u = 0
h = a + b
m = c + x
s = y + z
'To set the display as "00:00:00.00"
Label1.Text = h + ":" + m + ":" + s + "." + u
End Sub
'Subroutine for the timer count function using if then statements
Sub CountTime()
If Val(u) < 9 Then
u = u + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(z) < 9 Then
u = 0
z = z + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(y) < 5 Then
u = 0
z = 0
y = y + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u + v
ElseIf Val(x) < 9 Then
u = 0
z = 0
y = 0
x = x + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(c) < 5 Then
u = 0
z = 0
y = 0
x = 0
c = c + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(b) < 9 Then
u = 0
z = 0
y = 0
x = 0
c = 0
b = b + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(b) < 9 Then
u = 0
z = 0
y = 0
x = 0
c = 0
b = b + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
ElseIf Val(a) < 9 Then
u = 0
z = 0
y = 0
x = 0
c = 0
b = 0
a = a + 1
Label1.Text = a + b + ":" + c + x + ":" + y + z + "." + u
End If
End Sub
'Use the CountTime subroutine for Timer1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
CountTime()
End Sub
Private Sub Start_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start_Button.Click
'Start
Timer1.Enabled = True
End Sub
Private Sub Stop_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Stop_Button.Click
'Stop
Timer1.Enabled = False
End Sub
Private Sub Reset_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reset_Button.Click
'Reset - (Set everything back to 0's)
Timer1.Enabled = False
a = "0"
b = "0"
c = "0"
x = "0"
y = "0"
z = "0"
u = "0"
h = a + b
m = c + x
s = y + z
'To set the display as "00:00:00.00"
Label1.Text = h + ":" + m + ":" + s + "." + u
End Sub
'Close The application
Private Sub Close_App_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close_App.Click
End
End Sub
'Extra crap
'Make windows OnTop option active or inactive
Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
'if it's ticked, then keep above all other windows
If CheckBox1.Checked Then
Me.TopMost = True
'If it's not ticked then don't keep it above all other windows
ElseIf CheckBox1.Checked = False Then
Me.TopMost = False
End If
End Sub
End Class
Direct Download:
http://download789.mediafire.com/9mmf76q.../Timer.exe