Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.Net Coding Challenge #3
#14
Here's my submission anyway:

[Image: unledoy.png]

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
Reply


Messages In This Thread
.Net Coding Challenge #3 - by Resistance - 04-18-2011, 01:07 PM
RE: .Net Coding Challenge #3 - by Fragma - 04-18-2011, 01:37 PM
RE: .Net Coding Challenge #3 - by Untouch - 04-18-2011, 01:55 PM
RE: .Net Coding Challenge #3 - by KoBE - 04-18-2011, 03:04 PM
RE: .Net Coding Challenge #3 - by Modestep - 04-18-2011, 02:16 PM
RE: .Net Coding Challenge #3 - by Resistance - 04-18-2011, 02:54 PM
RE: .Net Coding Challenge #3 - by Fragma - 04-19-2011, 04:02 AM
RE: .Net Coding Challenge #3 - by KoBE - 04-19-2011, 10:23 AM
RE: .Net Coding Challenge #3 - by Fragma - 04-19-2011, 10:27 AM
RE: .Net Coding Challenge #3 - by KoBE - 04-19-2011, 10:30 AM
RE: .Net Coding Challenge #3 - by AceInfinity - 04-19-2011, 11:01 AM
RE: .Net Coding Challenge #3 - by KoBE - 04-19-2011, 01:07 PM
RE: .Net Coding Challenge #3 - by AceInfinity - 04-19-2011, 02:59 PM
RE: .Net Coding Challenge #3 - by AceInfinity - 04-19-2011, 04:54 PM
RE: .Net Coding Challenge #3 - by KoBE - 04-20-2011, 06:34 AM
RE: .Net Coding Challenge #3 - by AceInfinity - 04-20-2011, 01:26 PM
RE: .Net Coding Challenge #3 - by iCrack - 05-04-2011, 10:46 AM
RE: .Net Coding Challenge #3 - by AceInfinity - 05-04-2011, 10:55 AM
RE: .Net Coding Challenge #3 - by iCrack - 05-04-2011, 11:09 AM
RE: .Net Coding Challenge #3 - by KoBE - 05-04-2011, 04:15 PM
RE: .Net Coding Challenge #3 - by iCrack - 05-05-2011, 10:06 AM
RE: .Net Coding Challenge #3 - by KoBE - 05-05-2011, 10:34 AM
RE: .Net Coding Challenge #3 - by AceInfinity - 05-05-2011, 03:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code Challenge - Created by Ace AceInfinity 5 1,713 04-24-2012, 10:27 AM
Last Post: AceInfinity
  Help with coding jerrojack 1 882 12-29-2011, 03:27 AM
Last Post: AceInfinity
  Coding-Central.net - Coding, cracking and webmastering. w00pz 5 2,436 09-02-2011, 01:43 PM
Last Post: AceInfinity
  Help Coding A Downloader? Fragma 9 3,432 08-25-2011, 06:10 PM
Last Post: LiveModz
  .Net Coding Challenge #5 iCrack 18 5,937 05-21-2011, 12:49 AM
Last Post: thanasis2028

Forum Jump:


Users browsing this thread: 15 Guest(s)