How To Make A Scoreboard In Visual Basic
To make a scoreboard in Visual Basic, create a Windows Forms app, add labels for the team names and scores, and connect scoring buttons to Click event handlers. Store each score in an Integer variable, then update the labels whenever a value changes. Start with.
Which licences fit your PC setup?
Prices are an AUD snapshot, not a live quote. Confirm variant and total on the listing.
-

Windows 11 Pro key
$14.99 AUD
$29.00 -

Office 2024 Pro Plus key
$20.00 AUD
$39.00 -

Windows 11 Home key
$18.88 AUD
$37.00
Create a Visual Basic Windows Forms project
This walkthrough builds a two-team desktop scoreboard using VB.NET in Visual Studio. It assumes each scoring action adds or removes one point and scores cannot fall below zero. Adjust those rules for your game once the basic application works.
- Install Visual Studio with the .NET desktop development workload.
- Create a project using the Windows Forms App template with Visual Basic selected as the language.
- Name the project Scoreboard and open its main form in the designer.
- Keep the Toolbox, Properties window and Solution Explorer available as you work.
Microsoft’s Visual Basic Windows Forms tutorial explains the project and designer workflow. For related language topics, browse the Visual Basic guides.
Build a readable scoreboard interface
Drag controls from the Toolbox onto the form. Set each control’s (Name) property before writing its event handlers; this is the identifier used in your code. The Text property controls what the operator sees.
- Add two team-name labels with Text values of Home and Away.
- Add score labels named lblHomeScore and lblAwayScore. Set both Text values to 0.
- Add buttons named btnHomePlus and btnAwayPlus, with Text values of Home +1 and Away +1.
- Add buttons named btnHomeMinus and btnAwayMinus, with Text values of Home -1 and Away -1.
- Add a button named btnReset, with its Text set to Reset scores.
Place each team’s controls together, with the score above its buttons. Use a large score font and enough space for the highest score you expect. If you give the labels fixed dimensions, set AutoSize to False and use TextAlign to centre the numbers.
Style standard Windows Forms controls through properties such as Font, ForeColor and BackColor. For feedback on operator actions, the guide to changing a button’s colour when clicked provides a related example. Keep the button text clear so colour is not the only indication of its function.
Store scores separately from the labels
Open the form’s code file. Inside the form class, below its opening Class line and outside any existing procedure, add these two declarations:
Private homeScore As Integer = 0
Private awayScore As Integer = 0
These fields hold the scores while the form is open. Keeping numeric values separate from the display avoids repeatedly converting label text back into numbers.
Add one procedure to refresh the display
Still inside the form class, but outside other procedures, add the following procedure. Enter each displayed statement on its own line:
Private Sub UpdateScores()
lblHomeScore.Text = homeScore.ToString()
lblAwayScore.Text = awayScore.ToString()
End Sub
Call UpdateScores after changing either score. Both labels then reflect the current values through the same display logic. The initial label text and field values are already set to zero.
Connect the scoring buttons
Return to the designer and double-click a button to generate its Click event handler. Put the relevant statements below inside that handler, between its Sub declaration and End Sub. Keep the generated declaration, including its Handles clause.
- For btnHomePlus, add these statements:
homeScore += 1
UpdateScores()
- For btnAwayPlus, add:
awayScore += 1
UpdateScores()
- For btnHomeMinus, add:
If homeScore > 0 Then homeScore -= 1
UpdateScores()
- For btnAwayMinus, add:
If awayScore > 0 Then awayScore -= 1
UpdateScores()
- For btnReset, add:
homeScore = 0
awayScore = 0
UpdateScores()
The subtraction checks enforce the zero minimum. If your game allows penalties that produce negative totals, change that rule deliberately. For sports with different point values, add clearly labelled buttons and adjust the amount added by each handler.
Keep the fields and procedures in the form for this first version. If you later share scoring logic between forms, read how to call a module in Visual Basic before reorganising the application.
Test the scoring rules and event connections
Run the application from Visual Studio and check these behaviours:
- Both scores start at zero.
- Each +1 button changes only its own team’s score.
- Each -1 button removes one point, but leaves zero unchanged.
- Reset returns both scores to zero after several scoring actions.
- Larger scores remain fully visible, and resizing the window keeps the controls usable.
If a button does nothing, check that its handler is connected to the correct control’s Click event. If one click adds two points, look for duplicate event subscriptions or repeated increment statements. If a control name is underlined in the editor, compare it with the designer’s (Name) property.
Add a match clock or saved results when needed
Use a timer to refresh the clock
A match clock needs its own timekeeping logic. Add a clock label, a Windows Forms Timer component, and Start and Pause buttons. Use the timer’s Tick event to refresh the clock label; continue changing scores only through scoring actions.
Timer ticks can be delayed when the application is busy, as Microsoft explains in its timer interval guidance. Measure elapsed time with System.Diagnostics.Stopwatch rather than assuming every tick represents an exact elapsed interval. For a countdown, subtract elapsed time from the match duration, clamp the display at zero and stop the clock when time expires.
Save validated data and restore it together
To resume a match after closing the application, save the team names and numeric scores to a file. Include clock state if resuming the time matters. When loading, validate the entire record before replacing the current scores, then call UpdateScores.
Use Integer.TryParse for text-based scores and apply your game’s allowed range. Handle missing files, invalid data and file-access errors with a clear message. A failed load should leave the current match intact.
Run the basic scoreboard now and complete one mock match, including a score correction and reset. Use that trial to decide whether the next useful addition is a clock, saved results or extra scoring buttons.
Other editions for separate workloads
Other editions for separate workloads; prices in AUD, confirm the total on the listing.
-

Windows 10 Pro key
$12.00 AUD
$15.00 -

Microsoft 365 Pro Plus, 5 devices
$15.00 AUD
$29.00 -

Windows Server 2022 Standard
$120.00 AUD
$239.00
How to check this worked
- Open Settings, System, Activation and confirm the edition shown.
- Enter the key and run activation; expect a green tick within a minute.
- Reboot and re-check activation survives the restart.
FAQ
What else should you know before buying?
- What do I need before starting?
- Read the requirements and confirm the edition first; the steps assume the machine is compatible.
- How do I know the licence is genuine?
- Activate on Microsoft's servers and check Settings, System, Activation. A working activation is the test.
- Is this a subscription?
- Keys sold here are one-time lifetime licences. Microsoft 365 plans are billed by Microsoft instead.
- What if the key fails?
- Email hi@ms.codes with the order number and a screenshot. Replacement or refund applies within 30 days.
Check who prepared and reviewed this guide
- Written by
- MS.Codes editorial
- Reviewed by
- Support team
Last verified: (source review; see test status above).