Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim strWord As String
- Dim strGuess As String
- Dim strWrongLetters As String
- Dim random As New Random
- Dim dblWordNumber As Double
- Dim BooPosition1 As Boolean = False
- Dim BooPosition2 As Boolean = False
- Dim BooPosition3 As Boolean = False
- Dim BooPosition4 As Boolean = False
- Dim BooWrongGuess As Boolean = False
- Dim BooGuess1 As Boolean
- Dim BooGuess2 As Boolean
- Dim BooGuess3 As Boolean
- Dim BooGuess4 As Boolean
- Dim BooWin As Boolean
- Private Property lblYouLose As Object
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- BooWrongGuess = False
- BooPosition1 = False
- BooPosition2 = False
- BooPosition3 = False
- booPosition4 = False
- dblWordNumber = random.Next(11)
- strWord = lstWords.Items(dblWordNumber)
- 'Debugging stuff to be deleted later
- 'dblWordNumber = random.Next(11)
- txtRandomWordNumber.Text = dblWordNumber
- txtSelectedWord.Text = lstWords.Items(dblWordNumber)
- End Sub
- Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
- txtLetterSelected.Text = String.Empty 'Debugging to be deleted later
- txtWrongGuesses.Text = String.Empty
- txtGuessWord.Text = String.Empty
- lblPosition1.Text = String.Empty
- lblPosition2.Text = String.Empty
- lblPosition3.Text = String.Empty
- lblPosition4.Text = String.Empty
- btnA.Visible = True
- btnB.Visible = True
- btnC.Visible = True
- btnD.Visible = True
- btnE.Visible = True
- btnF.Visible = True
- btnG.Visible = True
- btnH.Visible = True
- btnI.Visible = True
- btnJ.Visible = True
- btnK.Visible = True
- btnL.Visible = True
- btnM.Visible = True
- btnN.Visible = True
- btnO.Visible = True
- btnP.Visible = True
- btnQ.Visible = True
- btnR.Visible = True
- btnS.Visible = True
- btnT.Visible = True
- btnU.Visible = True
- btnV.Visible = True
- btnW.Visible = True
- btnX.Visible = True
- btnY.Visible = True
- btnZ.Visible = True
- dblWordNumber = random.Next(11)
- strWord = lstWords.Items(dblWordNumber)
- 'Debugging stuff to be deleted later
- 'dblWordNumber = random.Next(11)
- txtRandomWordNumber.Text = dblWordNumber
- txtSelectedWord.Text = lstWords.Items(dblWordNumber)
- End Sub
- Private Sub btnA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnA.Click
- BooWrongGuess = False
- btnA.Visible = False
- If strWord.Substring(0, 1) = "A" Then
- lblPosition1.Text = "A"
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "A" Then
- lblPosition2.Text = "A"
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "A" Then
- lblPosition3.Text = "A"
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "A" Then
- lblPosition4.Text = "A"
- Else
- BooWrongGuess = True
- End If
- 'If strWord.Substring(3, 1) = "A" Then
- ' lblPosition4.Text = "A"
- ' BooPosition4 = True
- 'Else
- ' BooPosition4 = False
- ' BooGuess4 = True
- 'End If
- 'If BooGuess1 And BooGuess2 And BooGuess3 And BooGuess4 = True Then
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " A"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnB.Click
- btnB.Visible = False
- BooWrongGuess = False
- If strWord.Substring(0, 1) = "B" Then
- lblPosition1.Text = "B"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "B" Then
- lblPosition2.Text = "B"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "B" Then
- lblPosition3.Text = "B"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "B" Then
- lblPosition4.Text = "B"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " B"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- 'If Not IsNumeric(lblPosition1.Text) = True Then BooPosition1 = True
- 'If Not IsNumeric(lblPosition2.Text) = True Then BooPosition2 = True
- 'If Not IsNumeric(lblPosition3.Text) = True Then BooPosition3 = True
- 'If Not IsNumeric(lblPosition4.Text) = True Then BooPosition4 = True
- 'MessageBox.Show("You Win!")
- 'If BooPosition1 = True And BooPosition2 = True And BooPosition3 = True And BooPosition4 = True Then
- ' MessageBox.Show("You Win!")
- 'End If
- End Sub
- Private Sub btnC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnC.Click
- btnC.Visible = False
- If strWord.Substring(0, 1) = "C" Then
- lblPosition1.Text = "C"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "C" Then
- lblPosition2.Text = "C"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "C" Then
- lblPosition3.Text = "C"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "C" Then
- lblPosition4.Text = "C"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " C"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnD.Click
- btnD.Visible = False
- If strWord.Substring(0, 1) = "D" Then
- lblPosition1.Text = "D"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "D" Then
- BooWrongGuess = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "D" Then
- BooWrongGuess = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "D" Then
- lblPosition4.Text = "D"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " D"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnE.Click
- btnE.Visible = False
- If strWord.Substring(0, 1) = "E" Then
- lblPosition1.Text = "E"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "E" Then
- lblPosition2.Text = "E"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "E" Then
- lblPosition3.Text = "E"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "E" Then
- lblPosition4.Text = "E"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " E"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF.Click
- btnF.Visible = False
- If strWord.Substring(0, 1) = "F" Then
- lblPosition1.Text = "F"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "F" Then
- lblPosition2.Text = "F"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "F" Then
- lblPosition3.Text = "F"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "F" Then
- lblPosition4.Text = "F"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " F"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnG.Click
- btnG.Visible = False
- If strWord.Substring(0, 1) = "G" Then
- lblPosition1.Text = "G"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "G" Then
- lblPosition2.Text = "G"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "G" Then
- lblPosition3.Text = "G"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "G" Then
- lblPosition4.Text = "G"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " G"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnH.Click
- btnH.Visible = False
- If strWord.Substring(0, 1) = "H" Then
- lblPosition1.Text = "H"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "H" Then
- lblPosition2.Text = "H"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "H" Then
- lblPosition3.Text = "H"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "H" Then
- lblPosition4.Text = "H"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " H"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnI.Click
- btnI.Visible = False
- If strWord.Substring(0, 1) = "I" Then
- lblPosition1.Text = "I"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "I" Then
- lblPosition2.Text = "I"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "I" Then
- lblPosition3.Text = "I"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "I" Then
- lblPosition4.Text = "I"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " I"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnJ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnJ.Click
- btnJ.Visible = False
- If strWord.Substring(0, 1) = "J" Then
- lblPosition1.Text = "J"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "J" Then
- lblPosition2.Text = "J"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "J" Then
- lblPosition3.Text = "J"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "J" Then
- lblPosition4.Text = "J"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " J"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnK.Click
- btnK.Visible = False
- If strWord.Substring(0, 1) = "K" Then
- lblPosition1.Text = "K"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "K" Then
- lblPosition2.Text = "K"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "K" Then
- lblPosition3.Text = "K"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "K" Then
- lblPosition4.Text = "K"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " K"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnL.Click
- btnL.Visible = False
- If strWord.Substring(0, 1) = "L" Then
- lblPosition1.Text = "L"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "L" Then
- lblPosition2.Text = "L"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "L" Then
- lblPosition3.Text = "L"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "L" Then
- lblPosition4.Text = "L"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " L"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnM.Click
- btnM.Visible = False
- If strWord.Substring(0, 1) = "M" Then
- lblPosition1.Text = "M"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "M" Then
- lblPosition2.Text = "M"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "M" Then
- lblPosition3.Text = "M"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "M" Then
- lblPosition4.Text = "M"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " M"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnN.Click
- btnN.Visible = False
- If strWord.Substring(0, 1) = "N" Then
- lblPosition1.Text = "N"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "N" Then
- lblPosition2.Text = "N"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "N" Then
- lblPosition3.Text = "N"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "N" Then
- lblPosition4.Text = "N"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " N"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnO.Click
- btnO.Visible = False
- If strWord.Substring(0, 1) = "O" Then
- lblPosition1.Text = "O"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "O" Then
- lblPosition2.Text = "O"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "O" Then
- lblPosition3.Text = "O"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "O" Then
- lblPosition4.Text = "O"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " O"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnP.Click
- btnP.Visible = False
- If strWord.Substring(0, 1) = "P" Then
- lblPosition1.Text = "P"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "P" Then
- lblPosition2.Text = "P"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "P" Then
- lblPosition3.Text = "P"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "P" Then
- lblPosition4.Text = "P"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " P"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnQ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQ.Click
- btnQ.Visible = False
- If strWord.Substring(0, 1) = "Q" Then
- lblPosition1.Text = "Q"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "Q" Then
- lblPosition2.Text = "Q"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "Q" Then
- lblPosition3.Text = "Q"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "Q" Then
- lblPosition4.Text = "Q"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " Q"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnR.Click
- btnR.Visible = False
- If strWord.Substring(0, 1) = "R" Then
- lblPosition1.Text = "R"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "R" Then
- lblPosition2.Text = "R"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "R" Then
- lblPosition3.Text = "R"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "R" Then
- lblPosition4.Text = "R"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " R"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnS.Click
- btnS.Visible = False
- If strWord.Substring(0, 1) = "S" Then
- lblPosition1.Text = "S"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "S" Then
- lblPosition2.Text = "S"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "S" Then
- lblPosition3.Text = "S"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "S" Then
- lblPosition4.Text = "S"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " S"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnT.Click
- btnT.Visible = False
- If strWord.Substring(0, 1) = "T" Then
- lblPosition1.Text = "T"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "T" Then
- lblPosition2.Text = "T"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "T" Then
- lblPosition3.Text = "T"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "T" Then
- lblPosition4.Text = "T"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " T"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnU_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnU.Click
- btnU.Visible = False
- BooWrongGuess = False
- If strWord.Substring(0, 1) = "U" Then
- lblPosition1.Text = "U"
- BooPosition1 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "U" Then
- lblPosition2.Text = "U"
- BooPosition2 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "U" Then
- lblPosition3.Text = "U"
- BooPosition2 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "U" Then
- lblPosition4.Text = "U"
- BooPosition4 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " U"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnV.Click
- btnV.Visible = False
- If strWord.Substring(0, 1) = "V" Then
- lblPosition1.Text = "V"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "V" Then
- lblPosition2.Text = "V"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "V" Then
- lblPosition3.Text = "V"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "V" Then
- lblPosition4.Text = "V"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " V"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnW.Click
- btnW.Visible = False
- If strWord.Substring(0, 1) = "W" Then
- lblPosition1.Text = "W"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "W" Then
- lblPosition2.Text = "W"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "W" Then
- lblPosition3.Text = "W"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "W" Then
- lblPosition4.Text = "W"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " W"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnX.Click
- btnX.Visible = False
- If strWord.Substring(0, 1) = "X" Then
- lblPosition1.Text = "X"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "X" Then
- lblPosition2.Text = "X"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "X" Then
- lblPosition3.Text = "X"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "X" Then
- lblPosition4.Text = "X"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " X"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnY.Click
- btnY.Visible = False
- If strWord.Substring(0, 1) = "Y" Then
- lblPosition1.Text = "Y"
- BooPosition1 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "Y" Then
- lblPosition2.Text = "Y"
- BooPosition2 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "Y" Then
- lblPosition3.Text = "Y"
- BooPosition3 = True
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "Y" Then
- lblPosition4.Text = "Y"
- BooPosition4 = True
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " Y"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- Private Sub btnZ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZ.Click
- btnZ.Visible = False
- BooWrongGuess = False
- If strWord.Substring(0, 1) = "Z" Then
- lblPosition1.Text = "Z"
- BooPosition1 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(1, 1) = "Z" Then
- lblPosition2.Text = "Z"
- BooPosition2 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(2, 1) = "Z" Then
- lblPosition3.Text = "Z"
- BooPosition3 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If strWord.Substring(3, 1) = "Z" Then
- lblPosition4.Text = "Z"
- BooPosition4 = True
- BooWrongGuess = False
- Else
- BooWrongGuess = True
- End If
- If BooWrongGuess = True Then
- txtWrongGuesses.Text = txtWrongGuesses.Text & " Z"
- End If
- If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
- BooWin = False
- Else
- BooWin = True
- MessageBox.Show("You Win!")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment