Hi!
I'm trying to make a coin toss program using a random generator, but i'm not sure how to upload the image of the heads and tails from its file on my PC. Image names are Tails.gif and Heads.gif . Here's the code so far:
Public Class Form1
Dim headCount As Integer
Dim tailCount As Integer
Dim choice As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblHeadCt.Text = "Heads: " & Str(headCount)
lblTailCt.Text = "Heads: " & Str(tailCount)
End Sub
Private Sub cmdFlip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFlip.Click
Randomize()
choice = Int(Rnd() * 2)
If choice = 0 Then
headCount = headCount + 1
imgCoin = Image.FromFile()
Else
tailCount = tailCount + 1
imgCoin =
End If
End Sub
End Class
Thank you