soar-board106
New member
Hi, I'm new to the forum and I've been looking around the www and still can't find help for this. I have a scoreboard I'm devoloping...
...with the following code:
As you can see from the screen-shot, there are several labels. There is a timer (done), a period marker (the 0 next to the 20:00.0), Home/Away team labels, and 0's representing scores (under 1, 3, 6, 9 and T labels). There are H and A buttons underneath each set of 0's.
The H/A buttons need to increase the Home/Away 1, 3, 6 or 9 column by 1, therefore increasing the score by 1, 3, 6 or 9 (e.g. clicking the H under 9 increase Home Team's 9 column by 1 and Home Team's score by 9).
I have made an Excel spreadsheet to demonstrate what I need.
All help is appreciated.
soar-board
P.S. If I learn how to use int functions I may be able to complete this, so can someone please help with this.
...with the following code:
VB.NET:
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Enabled = False
Command1.Text = "Start"
Command2.Text = "Pause"
Label1.Text = "20:00.0"
End Sub
Private CountDownStart
Private Sub Command1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Command1.Click
If Not Timer1.Enabled Then
CountDownStart = Microsoft.VisualBasic.DateAndTime.Timer
Timer1.Enabled = True
Command1.Text = "Stop"
Command2.Text = "Pause"
Command2.Enabled = True
Else
Timer1.Enabled = False
'MsgBox("Final Time: " & Label1.Text & vbCrLf & vbCrLf & "Click OK to reset the clock.")
Label1.Text = "20:00.0"
Command1.Text = "Start"
Command2.Text = "-----"
Command2.Enabled = False
End If
End Sub
Private Sub Command2_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Command2.Click
Static PauseInterval
If Timer1.Enabled Then
PauseInterval = Microsoft.VisualBasic.DateAndTime.Timer - CountDownStart
Timer1.Enabled = False
Command1.Text = "Restart"
Command2.Text = "Resume"
Else
CountDownStart = Microsoft.VisualBasic.DateAndTime.Timer - PauseInterval
Timer1.Enabled = True
Command1.Text = "Stop"
Command2.Text = "Pause"
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim MinDiff
Dim SecDiff
Dim TenthDiff
Dim TimeDiff
TimeDiff = (12000) - Int((Microsoft.VisualBasic.DateAndTime.Timer - CountDownStart) * 10)
If TimeDiff >= 0 Then
TenthDiff = TimeDiff Mod 10
SecDiff = Int(TimeDiff / 10) Mod 60
MinDiff = Int(TimeDiff / 600)
Label1.Text = Format(MinDiff, "00") & ":" & Format(SecDiff, "00") & "." & Format(TenthDiff, "0")
Else
Label1.Text = "00:00.0"
Timer1.Enabled = False
MsgBox("!!!TIME!!!")
Command1.Text = "Start"
Command2.Text = "-----"
Command2.Enabled = False
End If
'Application.DoEvents()
End Sub
End Class
As you can see from the screen-shot, there are several labels. There is a timer (done), a period marker (the 0 next to the 20:00.0), Home/Away team labels, and 0's representing scores (under 1, 3, 6, 9 and T labels). There are H and A buttons underneath each set of 0's.
The H/A buttons need to increase the Home/Away 1, 3, 6 or 9 column by 1, therefore increasing the score by 1, 3, 6 or 9 (e.g. clicking the H under 9 increase Home Team's 9 column by 1 and Home Team's score by 9).
I have made an Excel spreadsheet to demonstrate what I need.
All help is appreciated.
soar-board
P.S. If I learn how to use int functions I may be able to complete this, so can someone please help with this.