Guest User

Hangman

a guest
May 11th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 35.64 KB | None | 0 0
  1. Public Class Form1
  2.     Dim strWord As String
  3.     Dim strGuess As String
  4.     Dim strWrongLetters As String
  5.     Dim random As New Random
  6.     Dim dblWordNumber As Double
  7.     Dim BooPosition1 As Boolean = False
  8.     Dim BooPosition2 As Boolean = False
  9.     Dim BooPosition3 As Boolean = False
  10.     Dim BooPosition4 As Boolean = False
  11.     Dim BooWrongGuess As Boolean = False
  12.     Dim BooGuess1 As Boolean
  13.     Dim BooGuess2 As Boolean
  14.     Dim BooGuess3 As Boolean
  15.     Dim BooGuess4 As Boolean
  16.     Dim BooWin As Boolean
  17.  
  18.     Private Property lblYouLose As Object
  19.  
  20.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  21.  
  22.         BooWrongGuess = False
  23.         BooPosition1 = False
  24.         BooPosition2 = False
  25.         BooPosition3 = False
  26.         booPosition4 = False
  27.  
  28.         dblWordNumber = random.Next(11)
  29.         strWord = lstWords.Items(dblWordNumber)
  30.  
  31.         'Debugging stuff to be deleted later
  32.         'dblWordNumber = random.Next(11)
  33.         txtRandomWordNumber.Text = dblWordNumber
  34.         txtSelectedWord.Text = lstWords.Items(dblWordNumber)
  35.     End Sub
  36.     Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
  37.  
  38.         txtLetterSelected.Text = String.Empty 'Debugging to be deleted later
  39.         txtWrongGuesses.Text = String.Empty
  40.         txtGuessWord.Text = String.Empty
  41.         lblPosition1.Text = String.Empty
  42.         lblPosition2.Text = String.Empty
  43.         lblPosition3.Text = String.Empty
  44.         lblPosition4.Text = String.Empty
  45.         btnA.Visible = True
  46.         btnB.Visible = True
  47.         btnC.Visible = True
  48.         btnD.Visible = True
  49.         btnE.Visible = True
  50.         btnF.Visible = True
  51.         btnG.Visible = True
  52.         btnH.Visible = True
  53.         btnI.Visible = True
  54.         btnJ.Visible = True
  55.         btnK.Visible = True
  56.         btnL.Visible = True
  57.         btnM.Visible = True
  58.         btnN.Visible = True
  59.         btnO.Visible = True
  60.         btnP.Visible = True
  61.         btnQ.Visible = True
  62.         btnR.Visible = True
  63.         btnS.Visible = True
  64.         btnT.Visible = True
  65.         btnU.Visible = True
  66.         btnV.Visible = True
  67.         btnW.Visible = True
  68.         btnX.Visible = True
  69.         btnY.Visible = True
  70.         btnZ.Visible = True
  71.         dblWordNumber = random.Next(11)
  72.         strWord = lstWords.Items(dblWordNumber)
  73.         'Debugging stuff to be deleted later
  74.         'dblWordNumber = random.Next(11)
  75.         txtRandomWordNumber.Text = dblWordNumber
  76.         txtSelectedWord.Text = lstWords.Items(dblWordNumber)
  77.     End Sub
  78.     Private Sub btnA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnA.Click
  79.         BooWrongGuess = False
  80.         btnA.Visible = False
  81.  
  82.         If strWord.Substring(0, 1) = "A" Then
  83.             lblPosition1.Text = "A"
  84.         Else
  85.             BooWrongGuess = True
  86.         End If
  87.  
  88.         If strWord.Substring(1, 1) = "A" Then
  89.             lblPosition2.Text = "A"
  90.         Else
  91.             BooWrongGuess = True
  92.         End If
  93.  
  94.         If strWord.Substring(2, 1) = "A" Then
  95.             lblPosition3.Text = "A"
  96.         Else
  97.             BooWrongGuess = True
  98.         End If
  99.  
  100.         If strWord.Substring(3, 1) = "A" Then
  101.             lblPosition4.Text = "A"
  102.         Else
  103.             BooWrongGuess = True
  104.         End If
  105.  
  106.         'If strWord.Substring(3, 1) = "A" Then
  107.         '    lblPosition4.Text = "A"
  108.         '    BooPosition4 = True
  109.         'Else
  110.         '    BooPosition4 = False
  111.         '    BooGuess4 = True
  112.         'End If
  113.  
  114.         'If BooGuess1 And BooGuess2 And BooGuess3 And BooGuess4 = True Then
  115.         If BooWrongGuess = True Then
  116.             txtWrongGuesses.Text = txtWrongGuesses.Text & " A"
  117.         End If
  118.  
  119.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  120.             BooWin = False
  121.         Else
  122.             BooWin = True
  123.             MessageBox.Show("You Win!")
  124.         End If
  125.  
  126.  
  127.     End Sub
  128.  
  129.     Private Sub btnB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnB.Click
  130.         btnB.Visible = False
  131.         BooWrongGuess = False
  132.  
  133.         If strWord.Substring(0, 1) = "B" Then
  134.             lblPosition1.Text = "B"
  135.             BooPosition1 = True
  136.         Else
  137.             BooWrongGuess = True
  138.         End If
  139.  
  140.         If strWord.Substring(1, 1) = "B" Then
  141.             lblPosition2.Text = "B"
  142.             BooPosition2 = True
  143.         Else
  144.             BooWrongGuess = True
  145.         End If
  146.  
  147.         If strWord.Substring(2, 1) = "B" Then
  148.             lblPosition3.Text = "B"
  149.             BooPosition3 = True
  150.         Else
  151.             BooWrongGuess = True
  152.         End If
  153.  
  154.         If strWord.Substring(3, 1) = "B" Then
  155.             lblPosition4.Text = "B"
  156.             BooPosition4 = True
  157.         Else
  158.             BooWrongGuess = True
  159.         End If
  160.  
  161.         If BooWrongGuess = True Then
  162.             txtWrongGuesses.Text = txtWrongGuesses.Text & " B"
  163.         End If
  164.  
  165.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  166.             BooWin = False
  167.         Else
  168.             BooWin = True
  169.             MessageBox.Show("You Win!")
  170.         End If
  171.  
  172.         'If Not IsNumeric(lblPosition1.Text) = True Then BooPosition1 = True
  173.         'If Not IsNumeric(lblPosition2.Text) = True Then BooPosition2 = True
  174.         'If Not IsNumeric(lblPosition3.Text) = True Then BooPosition3 = True
  175.         'If Not IsNumeric(lblPosition4.Text) = True Then BooPosition4 = True
  176.         'MessageBox.Show("You Win!")
  177.         'If BooPosition1 = True And BooPosition2 = True And BooPosition3 = True And BooPosition4 = True Then
  178.         '    MessageBox.Show("You Win!")
  179.         'End If
  180.  
  181.  
  182.     End Sub
  183.  
  184.     Private Sub btnC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnC.Click
  185.         btnC.Visible = False
  186.  
  187.         If strWord.Substring(0, 1) = "C" Then
  188.             lblPosition1.Text = "C"
  189.             BooPosition1 = True
  190.         Else
  191.             BooWrongGuess = True
  192.         End If
  193.  
  194.         If strWord.Substring(1, 1) = "C" Then
  195.             lblPosition2.Text = "C"
  196.             BooPosition2 = True
  197.         Else
  198.             BooWrongGuess = True
  199.         End If
  200.  
  201.         If strWord.Substring(2, 1) = "C" Then
  202.             lblPosition3.Text = "C"
  203.             BooPosition3 = True
  204.         Else
  205.             BooWrongGuess = True
  206.         End If
  207.  
  208.         If strWord.Substring(3, 1) = "C" Then
  209.             lblPosition4.Text = "C"
  210.             BooPosition4 = True
  211.         Else
  212.             BooWrongGuess = True
  213.         End If
  214.  
  215.         If BooWrongGuess = True Then
  216.             txtWrongGuesses.Text = txtWrongGuesses.Text & " C"
  217.         End If
  218.  
  219.       If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  220.             BooWin = False
  221.         Else
  222.             BooWin = True
  223.             MessageBox.Show("You Win!")
  224.         End If
  225.  
  226.  
  227.     End Sub
  228.  
  229.     Private Sub btnD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnD.Click
  230.         btnD.Visible = False
  231.  
  232.         If strWord.Substring(0, 1) = "D" Then
  233.             lblPosition1.Text = "D"
  234.             BooPosition1 = True
  235.         Else
  236.             BooWrongGuess = True
  237.         End If
  238.  
  239.         If strWord.Substring(1, 1) = "D" Then
  240.             BooWrongGuess = True
  241.         Else
  242.             BooWrongGuess = True
  243.         End If
  244.  
  245.         If strWord.Substring(2, 1) = "D" Then
  246.             BooWrongGuess = True
  247.         Else
  248.             BooWrongGuess = True
  249.         End If
  250.  
  251.         If strWord.Substring(3, 1) = "D" Then
  252.             lblPosition4.Text = "D"
  253.             BooPosition4 = True
  254.         Else
  255.             BooWrongGuess = True
  256.         End If
  257.  
  258.         If BooWrongGuess = True Then
  259.             txtWrongGuesses.Text = txtWrongGuesses.Text & " D"
  260.         End If
  261.  
  262.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  263.             BooWin = False
  264.         Else
  265.             BooWin = True
  266.             MessageBox.Show("You Win!")
  267.         End If
  268.  
  269.     End Sub
  270.  
  271.     Private Sub btnE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnE.Click
  272.         btnE.Visible = False
  273.  
  274.         If strWord.Substring(0, 1) = "E" Then
  275.             lblPosition1.Text = "E"
  276.             BooPosition1 = True
  277.         Else
  278.             BooWrongGuess = True
  279.         End If
  280.  
  281.         If strWord.Substring(1, 1) = "E" Then
  282.             lblPosition2.Text = "E"
  283.             BooPosition2 = True
  284.         Else
  285.             BooWrongGuess = True
  286.         End If
  287.  
  288.         If strWord.Substring(2, 1) = "E" Then
  289.             lblPosition3.Text = "E"
  290.             BooPosition3 = True
  291.         Else
  292.             BooWrongGuess = True
  293.         End If
  294.  
  295.         If strWord.Substring(3, 1) = "E" Then
  296.             lblPosition4.Text = "E"
  297.             BooPosition4 = True
  298.         Else
  299.             BooWrongGuess = True
  300.         End If
  301.  
  302.         If BooWrongGuess = True = True Then
  303.             txtWrongGuesses.Text = txtWrongGuesses.Text & " E"
  304.         End If
  305.  
  306.          If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  307.             BooWin = False
  308.         Else
  309.             BooWin = True
  310.             MessageBox.Show("You Win!")
  311.         End If
  312.  
  313.  
  314.     End Sub
  315.  
  316.     Private Sub btnF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF.Click
  317.         btnF.Visible = False
  318.  
  319.         If strWord.Substring(0, 1) = "F" Then
  320.             lblPosition1.Text = "F"
  321.             BooPosition1 = True
  322.         Else
  323.             BooWrongGuess = True
  324.         End If
  325.  
  326.         If strWord.Substring(1, 1) = "F" Then
  327.             lblPosition2.Text = "F"
  328.             BooPosition2 = True
  329.         Else
  330.             BooWrongGuess = True
  331.         End If
  332.  
  333.         If strWord.Substring(2, 1) = "F" Then
  334.             lblPosition3.Text = "F"
  335.             BooPosition3 = True
  336.         Else
  337.             BooWrongGuess = True
  338.         End If
  339.  
  340.         If strWord.Substring(3, 1) = "F" Then
  341.             lblPosition4.Text = "F"
  342.             BooPosition4 = True
  343.         Else
  344.             BooWrongGuess = True
  345.         End If
  346.  
  347.         If BooWrongGuess = True Then
  348.             txtWrongGuesses.Text = txtWrongGuesses.Text & " F"
  349.         End If
  350.  
  351.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  352.             BooWin = False
  353.         Else
  354.             BooWin = True
  355.             MessageBox.Show("You Win!")
  356.         End If
  357.  
  358.  
  359.     End Sub
  360.  
  361.     Private Sub btnG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnG.Click
  362.         btnG.Visible = False
  363.  
  364.         If strWord.Substring(0, 1) = "G" Then
  365.             lblPosition1.Text = "G"
  366.             BooPosition1 = True
  367.         Else
  368.             BooWrongGuess = True
  369.         End If
  370.  
  371.         If strWord.Substring(1, 1) = "G" Then
  372.             lblPosition2.Text = "G"
  373.             BooPosition2 = True
  374.         Else
  375.             BooWrongGuess = True
  376.         End If
  377.  
  378.         If strWord.Substring(2, 1) = "G" Then
  379.             lblPosition3.Text = "G"
  380.             BooPosition3 = True
  381.         Else
  382.             BooWrongGuess = True
  383.         End If
  384.  
  385.         If strWord.Substring(3, 1) = "G" Then
  386.             lblPosition4.Text = "G"
  387.             BooPosition4 = True
  388.         Else
  389.             BooWrongGuess = True
  390.         End If
  391.  
  392.         If BooWrongGuess = True Then
  393.             txtWrongGuesses.Text = txtWrongGuesses.Text & " G"
  394.         End If
  395.  
  396.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  397.             BooWin = False
  398.         Else
  399.             BooWin = True
  400.             MessageBox.Show("You Win!")
  401.         End If
  402.  
  403.  
  404.     End Sub
  405.  
  406.     Private Sub btnH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnH.Click
  407.         btnH.Visible = False
  408.  
  409.         If strWord.Substring(0, 1) = "H" Then
  410.             lblPosition1.Text = "H"
  411.             BooPosition1 = True
  412.         Else
  413.             BooWrongGuess = True
  414.         End If
  415.  
  416.         If strWord.Substring(1, 1) = "H" Then
  417.             lblPosition2.Text = "H"
  418.             BooPosition2 = True
  419.         Else
  420.            BooWrongGuess = True
  421.         End If
  422.  
  423.         If strWord.Substring(2, 1) = "H" Then
  424.             lblPosition3.Text = "H"
  425.             BooPosition3 = True
  426.         Else
  427.             BooWrongGuess = True
  428.         End If
  429.  
  430.         If strWord.Substring(3, 1) = "H" Then
  431.             lblPosition4.Text = "H"
  432.             BooPosition4 = True
  433.         Else
  434.             BooWrongGuess = True
  435.         End If
  436.  
  437.         If BooWrongGuess = True Then
  438.             txtWrongGuesses.Text = txtWrongGuesses.Text & " H"
  439.         End If
  440.  
  441.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  442.             BooWin = False
  443.         Else
  444.             BooWin = True
  445.             MessageBox.Show("You Win!")
  446.         End If
  447.  
  448.  
  449.  
  450.     End Sub
  451.  
  452.     Private Sub btnI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnI.Click
  453.         btnI.Visible = False
  454.  
  455.         If strWord.Substring(0, 1) = "I" Then
  456.             lblPosition1.Text = "I"
  457.             BooPosition1 = True
  458.         Else
  459.             BooWrongGuess = True
  460.         End If
  461.  
  462.         If strWord.Substring(1, 1) = "I" Then
  463.             lblPosition2.Text = "I"
  464.             BooPosition2 = True
  465.         Else
  466.             BooWrongGuess = True
  467.         End If
  468.  
  469.         If strWord.Substring(2, 1) = "I" Then
  470.             lblPosition3.Text = "I"
  471.             BooPosition3 = True
  472.         Else
  473.             BooWrongGuess = True
  474.         End If
  475.  
  476.         If strWord.Substring(3, 1) = "I" Then
  477.             lblPosition4.Text = "I"
  478.             BooPosition4 = True
  479.         Else
  480.             BooWrongGuess = True
  481.         End If
  482.  
  483.         If BooWrongGuess = True Then
  484.             txtWrongGuesses.Text = txtWrongGuesses.Text & " I"
  485.         End If
  486.  
  487.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  488.             BooWin = False
  489.         Else
  490.             BooWin = True
  491.             MessageBox.Show("You Win!")
  492.         End If
  493.  
  494.  
  495.  
  496.     End Sub
  497.  
  498.     Private Sub btnJ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnJ.Click
  499.         btnJ.Visible = False
  500.  
  501.         If strWord.Substring(0, 1) = "J" Then
  502.             lblPosition1.Text = "J"
  503.             BooPosition1 = True
  504.         Else
  505.             BooWrongGuess = True
  506.         End If
  507.  
  508.         If strWord.Substring(1, 1) = "J" Then
  509.             lblPosition2.Text = "J"
  510.             BooPosition2 = True
  511.         Else
  512.             BooWrongGuess = True
  513.         End If
  514.  
  515.         If strWord.Substring(2, 1) = "J" Then
  516.             lblPosition3.Text = "J"
  517.             BooPosition3 = True
  518.         Else
  519.             BooWrongGuess = True
  520.         End If
  521.  
  522.         If strWord.Substring(3, 1) = "J" Then
  523.             lblPosition4.Text = "J"
  524.             BooPosition4 = True
  525.         Else
  526.             BooWrongGuess = True
  527.         End If
  528.  
  529.         If BooWrongGuess = True Then
  530.             txtWrongGuesses.Text = txtWrongGuesses.Text & " J"
  531.         End If
  532.  
  533.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  534.             BooWin = False
  535.         Else
  536.             BooWin = True
  537.             MessageBox.Show("You Win!")
  538.         End If
  539.  
  540.  
  541.  
  542.     End Sub
  543.  
  544.     Private Sub btnK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnK.Click
  545.         btnK.Visible = False
  546.  
  547.         If strWord.Substring(0, 1) = "K" Then
  548.             lblPosition1.Text = "K"
  549.             BooPosition1 = True
  550.         Else
  551.             BooWrongGuess = True
  552.         End If
  553.  
  554.         If strWord.Substring(1, 1) = "K" Then
  555.             lblPosition2.Text = "K"
  556.             BooPosition2 = True
  557.         Else
  558.             BooWrongGuess = True
  559.         End If
  560.  
  561.         If strWord.Substring(2, 1) = "K" Then
  562.             lblPosition3.Text = "K"
  563.             BooPosition3 = True
  564.         Else
  565.             BooWrongGuess = True
  566.         End If
  567.  
  568.         If strWord.Substring(3, 1) = "K" Then
  569.             lblPosition4.Text = "K"
  570.             BooPosition4 = True
  571.         Else
  572.             BooWrongGuess = True
  573.         End If
  574.  
  575.         If BooWrongGuess = True Then
  576.             txtWrongGuesses.Text = txtWrongGuesses.Text & " K"
  577.         End If
  578.  
  579.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  580.             BooWin = False
  581.         Else
  582.             BooWin = True
  583.             MessageBox.Show("You Win!")
  584.         End If
  585.  
  586.  
  587.     End Sub
  588.  
  589.     Private Sub btnL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnL.Click
  590.         btnL.Visible = False
  591.  
  592.         If strWord.Substring(0, 1) = "L" Then
  593.             lblPosition1.Text = "L"
  594.             BooPosition1 = True
  595.         Else
  596.             BooWrongGuess = True
  597.         End If
  598.  
  599.         If strWord.Substring(1, 1) = "L" Then
  600.             lblPosition2.Text = "L"
  601.             BooPosition2 = True
  602.         Else
  603.             BooWrongGuess = True
  604.         End If
  605.  
  606.         If strWord.Substring(2, 1) = "L" Then
  607.             lblPosition3.Text = "L"
  608.             BooPosition3 = True
  609.         Else
  610.             BooWrongGuess = True
  611.         End If
  612.  
  613.         If strWord.Substring(3, 1) = "L" Then
  614.             lblPosition4.Text = "L"
  615.             BooPosition4 = True
  616.         Else
  617.             BooWrongGuess = True
  618.         End If
  619.  
  620.         If BooWrongGuess = True Then
  621.             txtWrongGuesses.Text = txtWrongGuesses.Text & " L"
  622.         End If
  623.  
  624.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  625.             BooWin = False
  626.         Else
  627.             BooWin = True
  628.             MessageBox.Show("You Win!")
  629.         End If
  630.  
  631.  
  632.     End Sub
  633.  
  634.     Private Sub btnM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnM.Click
  635.         btnM.Visible = False
  636.  
  637.         If strWord.Substring(0, 1) = "M" Then
  638.             lblPosition1.Text = "M"
  639.             BooPosition1 = True
  640.         Else
  641.             BooWrongGuess = True
  642.         End If
  643.  
  644.         If strWord.Substring(1, 1) = "M" Then
  645.             lblPosition2.Text = "M"
  646.             BooPosition2 = True
  647.         Else
  648.             BooWrongGuess = True
  649.         End If
  650.  
  651.         If strWord.Substring(2, 1) = "M" Then
  652.             lblPosition3.Text = "M"
  653.             BooPosition3 = True
  654.         Else
  655.             BooWrongGuess = True
  656.         End If
  657.  
  658.         If strWord.Substring(3, 1) = "M" Then
  659.             lblPosition4.Text = "M"
  660.             BooPosition4 = True
  661.         Else
  662.             BooWrongGuess = True
  663.         End If
  664.  
  665.         If BooWrongGuess = True Then
  666.             txtWrongGuesses.Text = txtWrongGuesses.Text & " M"
  667.         End If
  668.  
  669.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  670.             BooWin = False
  671.         Else
  672.             BooWin = True
  673.             MessageBox.Show("You Win!")
  674.         End If
  675.  
  676.  
  677.  
  678.     End Sub
  679.  
  680.     Private Sub btnN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnN.Click
  681.         btnN.Visible = False
  682.  
  683.         If strWord.Substring(0, 1) = "N" Then
  684.             lblPosition1.Text = "N"
  685.             BooPosition1 = True
  686.         Else
  687.             BooWrongGuess = True
  688.         End If
  689.  
  690.         If strWord.Substring(1, 1) = "N" Then
  691.             lblPosition2.Text = "N"
  692.             BooPosition2 = True
  693.         Else
  694.             BooWrongGuess = True
  695.         End If
  696.  
  697.         If strWord.Substring(2, 1) = "N" Then
  698.             lblPosition3.Text = "N"
  699.             BooPosition3 = True
  700.         Else
  701.             BooWrongGuess = True
  702.         End If
  703.  
  704.         If strWord.Substring(3, 1) = "N" Then
  705.             lblPosition4.Text = "N"
  706.             BooPosition4 = True
  707.         Else
  708.             BooWrongGuess = True
  709.         End If
  710.  
  711.         If BooWrongGuess = True Then
  712.             txtWrongGuesses.Text = txtWrongGuesses.Text & " N"
  713.         End If
  714.  
  715.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  716.             BooWin = False
  717.         Else
  718.             BooWin = True
  719.             MessageBox.Show("You Win!")
  720.         End If
  721.  
  722.  
  723.     End Sub
  724.  
  725.     Private Sub btnO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnO.Click
  726.         btnO.Visible = False
  727.  
  728.         If strWord.Substring(0, 1) = "O" Then
  729.             lblPosition1.Text = "O"
  730.             BooPosition1 = True
  731.         Else
  732.             BooWrongGuess = True
  733.         End If
  734.  
  735.         If strWord.Substring(1, 1) = "O" Then
  736.             lblPosition2.Text = "O"
  737.             BooPosition2 = True
  738.         Else
  739.             BooWrongGuess = True
  740.         End If
  741.  
  742.         If strWord.Substring(2, 1) = "O" Then
  743.             lblPosition3.Text = "O"
  744.             BooPosition3 = True
  745.         Else
  746.             BooWrongGuess = True
  747.         End If
  748.  
  749.         If strWord.Substring(3, 1) = "O" Then
  750.             lblPosition4.Text = "O"
  751.             BooPosition4 = True
  752.         Else
  753.             BooWrongGuess = True
  754.         End If
  755.  
  756.         If BooWrongGuess = True Then
  757.             txtWrongGuesses.Text = txtWrongGuesses.Text & " O"
  758.         End If
  759.  
  760.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  761.             BooWin = False
  762.         Else
  763.             BooWin = True
  764.             MessageBox.Show("You Win!")
  765.         End If
  766.  
  767.  
  768.     End Sub
  769.  
  770.     Private Sub btnP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnP.Click
  771.         btnP.Visible = False
  772.  
  773.         If strWord.Substring(0, 1) = "P" Then
  774.             lblPosition1.Text = "P"
  775.             BooPosition1 = True
  776.         Else
  777.             BooWrongGuess = True
  778.         End If
  779.  
  780.         If strWord.Substring(1, 1) = "P" Then
  781.             lblPosition2.Text = "P"
  782.             BooPosition2 = True
  783.         Else
  784.             BooWrongGuess = True
  785.         End If
  786.  
  787.         If strWord.Substring(2, 1) = "P" Then
  788.             lblPosition3.Text = "P"
  789.             BooPosition3 = True
  790.         Else
  791.             BooWrongGuess = True
  792.         End If
  793.  
  794.         If strWord.Substring(3, 1) = "P" Then
  795.             lblPosition4.Text = "P"
  796.             BooPosition4 = True
  797.         Else
  798.             BooWrongGuess = True
  799.         End If
  800.  
  801.         If BooWrongGuess = True Then
  802.             txtWrongGuesses.Text = txtWrongGuesses.Text & " P"
  803.         End If
  804.  
  805.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  806.             BooWin = False
  807.         Else
  808.             BooWin = True
  809.             MessageBox.Show("You Win!")
  810.         End If
  811.  
  812.  
  813.  
  814.     End Sub
  815.  
  816.     Private Sub btnQ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQ.Click
  817.         btnQ.Visible = False
  818.  
  819.         If strWord.Substring(0, 1) = "Q" Then
  820.             lblPosition1.Text = "Q"
  821.             BooPosition1 = True
  822.         Else
  823.             BooWrongGuess = True
  824.         End If
  825.  
  826.         If strWord.Substring(1, 1) = "Q" Then
  827.             lblPosition2.Text = "Q"
  828.             BooPosition2 = True
  829.         Else
  830.             BooWrongGuess = True
  831.         End If
  832.  
  833.         If strWord.Substring(2, 1) = "Q" Then
  834.             lblPosition3.Text = "Q"
  835.             BooPosition3 = True
  836.         Else
  837.             BooWrongGuess = True
  838.         End If
  839.  
  840.         If strWord.Substring(3, 1) = "Q" Then
  841.             lblPosition4.Text = "Q"
  842.             BooPosition4 = True
  843.         Else
  844.             BooWrongGuess = True
  845.         End If
  846.  
  847.         If BooWrongGuess = True Then
  848.             txtWrongGuesses.Text = txtWrongGuesses.Text & " Q"
  849.         End If
  850.  
  851.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  852.             BooWin = False
  853.         Else
  854.             BooWin = True
  855.             MessageBox.Show("You Win!")
  856.         End If
  857.  
  858.  
  859.     End Sub
  860.  
  861.     Private Sub btnR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnR.Click
  862.         btnR.Visible = False
  863.  
  864.         If strWord.Substring(0, 1) = "R" Then
  865.             lblPosition1.Text = "R"
  866.             BooPosition1 = True
  867.         Else
  868.             BooWrongGuess = True
  869.         End If
  870.  
  871.         If strWord.Substring(1, 1) = "R" Then
  872.             lblPosition2.Text = "R"
  873.             BooPosition2 = True
  874.         Else
  875.             BooWrongGuess = True
  876.         End If
  877.  
  878.         If strWord.Substring(2, 1) = "R" Then
  879.             lblPosition3.Text = "R"
  880.             BooPosition3 = True
  881.         Else
  882.             BooWrongGuess = True
  883.         End If
  884.  
  885.         If strWord.Substring(3, 1) = "R" Then
  886.             lblPosition4.Text = "R"
  887.             BooPosition4 = True
  888.         Else
  889.             BooWrongGuess = True
  890.         End If
  891.  
  892.         If BooWrongGuess = True Then
  893.             txtWrongGuesses.Text = txtWrongGuesses.Text & " R"
  894.         End If
  895.  
  896.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  897.             BooWin = False
  898.         Else
  899.             BooWin = True
  900.             MessageBox.Show("You Win!")
  901.         End If
  902.  
  903.  
  904.     End Sub
  905.  
  906.     Private Sub btnS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnS.Click
  907.         btnS.Visible = False
  908.  
  909.         If strWord.Substring(0, 1) = "S" Then
  910.             lblPosition1.Text = "S"
  911.             BooPosition1 = True
  912.         Else
  913.             BooWrongGuess = True
  914.         End If
  915.  
  916.         If strWord.Substring(1, 1) = "S" Then
  917.             lblPosition2.Text = "S"
  918.             BooPosition2 = True
  919.         Else
  920.             BooWrongGuess = True
  921.         End If
  922.  
  923.         If strWord.Substring(2, 1) = "S" Then
  924.             lblPosition3.Text = "S"
  925.             BooPosition3 = True
  926.         Else
  927.             BooWrongGuess = True
  928.         End If
  929.  
  930.         If strWord.Substring(3, 1) = "S" Then
  931.             lblPosition4.Text = "S"
  932.             BooPosition4 = True
  933.         Else
  934.             BooWrongGuess = True
  935.         End If
  936.  
  937.         If BooWrongGuess = True Then
  938.             txtWrongGuesses.Text = txtWrongGuesses.Text & " S"
  939.         End If
  940.  
  941.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  942.             BooWin = False
  943.         Else
  944.             BooWin = True
  945.             MessageBox.Show("You Win!")
  946.         End If
  947.  
  948.  
  949.     End Sub
  950.  
  951.     Private Sub btnT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnT.Click
  952.         btnT.Visible = False
  953.  
  954.         If strWord.Substring(0, 1) = "T" Then
  955.             lblPosition1.Text = "T"
  956.             BooPosition1 = True
  957.         Else
  958.             BooWrongGuess = True
  959.         End If
  960.  
  961.         If strWord.Substring(1, 1) = "T" Then
  962.             lblPosition2.Text = "T"
  963.             BooPosition2 = True
  964.         Else
  965.             BooWrongGuess = True
  966.         End If
  967.  
  968.         If strWord.Substring(2, 1) = "T" Then
  969.             lblPosition3.Text = "T"
  970.             BooPosition3 = True
  971.         Else
  972.             BooWrongGuess = True
  973.         End If
  974.  
  975.         If strWord.Substring(3, 1) = "T" Then
  976.             lblPosition4.Text = "T"
  977.             BooPosition4 = True
  978.         Else
  979.             BooWrongGuess = True
  980.         End If
  981.  
  982.         If BooWrongGuess = True Then
  983.             txtWrongGuesses.Text = txtWrongGuesses.Text & " T"
  984.         End If
  985.  
  986.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  987.             BooWin = False
  988.         Else
  989.             BooWin = True
  990.             MessageBox.Show("You Win!")
  991.         End If
  992.  
  993.  
  994.     End Sub
  995.  
  996.     Private Sub btnU_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnU.Click
  997.         btnU.Visible = False
  998.         BooWrongGuess = False
  999.  
  1000.         If strWord.Substring(0, 1) = "U" Then
  1001.             lblPosition1.Text = "U"
  1002.             BooPosition1 = True
  1003.             BooWrongGuess = False
  1004.         Else
  1005.             BooWrongGuess = True
  1006.         End If
  1007.  
  1008.         If strWord.Substring(1, 1) = "U" Then
  1009.             lblPosition2.Text = "U"
  1010.             BooPosition2 = True
  1011.             BooWrongGuess = False
  1012.         Else
  1013.             BooWrongGuess = True
  1014.         End If
  1015.  
  1016.         If strWord.Substring(2, 1) = "U" Then
  1017.             lblPosition3.Text = "U"
  1018.             BooPosition2 = True
  1019.             BooWrongGuess = False
  1020.         Else
  1021.             BooWrongGuess = True
  1022.         End If
  1023.  
  1024.         If strWord.Substring(3, 1) = "U" Then
  1025.             lblPosition4.Text = "U"
  1026.             BooPosition4 = True
  1027.             BooWrongGuess = False
  1028.         Else
  1029.             BooWrongGuess = True
  1030.         End If
  1031.  
  1032.         If BooWrongGuess = True Then
  1033.             txtWrongGuesses.Text = txtWrongGuesses.Text & " U"
  1034.         End If
  1035.  
  1036.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1037.             BooWin = False
  1038.         Else
  1039.             BooWin = True
  1040.             MessageBox.Show("You Win!")
  1041.         End If
  1042.  
  1043.  
  1044.     End Sub
  1045.  
  1046.     Private Sub btnV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnV.Click
  1047.         btnV.Visible = False
  1048.  
  1049.         If strWord.Substring(0, 1) = "V" Then
  1050.             lblPosition1.Text = "V"
  1051.             BooPosition1 = True
  1052.         Else
  1053.             BooWrongGuess = True
  1054.         End If
  1055.  
  1056.         If strWord.Substring(1, 1) = "V" Then
  1057.             lblPosition2.Text = "V"
  1058.             BooPosition2 = True
  1059.         Else
  1060.             BooWrongGuess = True
  1061.         End If
  1062.  
  1063.         If strWord.Substring(2, 1) = "V" Then
  1064.             lblPosition3.Text = "V"
  1065.             BooPosition3 = True
  1066.         Else
  1067.             BooWrongGuess = True
  1068.         End If
  1069.  
  1070.         If strWord.Substring(3, 1) = "V" Then
  1071.             lblPosition4.Text = "V"
  1072.             BooPosition4 = True
  1073.         Else
  1074.             BooWrongGuess = True
  1075.         End If
  1076.  
  1077.         If BooWrongGuess = True Then
  1078.             txtWrongGuesses.Text = txtWrongGuesses.Text & " V"
  1079.         End If
  1080.  
  1081.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1082.             BooWin = False
  1083.         Else
  1084.             BooWin = True
  1085.             MessageBox.Show("You Win!")
  1086.         End If
  1087.  
  1088.  
  1089.  
  1090.     End Sub
  1091.  
  1092.     Private Sub btnW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnW.Click
  1093.  
  1094.  
  1095.         btnW.Visible = False
  1096.  
  1097.         If strWord.Substring(0, 1) = "W" Then
  1098.             lblPosition1.Text = "W"
  1099.             BooPosition1 = True
  1100.         Else
  1101.             BooWrongGuess = True
  1102.         End If
  1103.  
  1104.         If strWord.Substring(1, 1) = "W" Then
  1105.             lblPosition2.Text = "W"
  1106.             BooPosition2 = True
  1107.         Else
  1108.             BooWrongGuess = True
  1109.         End If
  1110.  
  1111.         If strWord.Substring(2, 1) = "W" Then
  1112.             lblPosition3.Text = "W"
  1113.             BooPosition3 = True
  1114.         Else
  1115.             BooWrongGuess = True
  1116.         End If
  1117.  
  1118.         If strWord.Substring(3, 1) = "W" Then
  1119.             lblPosition4.Text = "W"
  1120.             BooPosition4 = True
  1121.         Else
  1122.             BooWrongGuess = True
  1123.         End If
  1124.  
  1125.         If BooWrongGuess = True Then
  1126.             txtWrongGuesses.Text = txtWrongGuesses.Text & " W"
  1127.         End If
  1128.  
  1129.        If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1130.             BooWin = False
  1131.         Else
  1132.             BooWin = True
  1133.             MessageBox.Show("You Win!")
  1134.         End If
  1135.  
  1136.     End Sub
  1137.  
  1138.     Private Sub btnX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnX.Click
  1139.  
  1140.         btnX.Visible = False
  1141.  
  1142.         If strWord.Substring(0, 1) = "X" Then
  1143.             lblPosition1.Text = "X"
  1144.             BooPosition1 = True
  1145.         Else
  1146.             BooWrongGuess = True
  1147.         End If
  1148.  
  1149.         If strWord.Substring(1, 1) = "X" Then
  1150.             lblPosition2.Text = "X"
  1151.             BooPosition2 = True
  1152.         Else
  1153.             BooWrongGuess = True
  1154.         End If
  1155.  
  1156.         If strWord.Substring(2, 1) = "X" Then
  1157.             lblPosition3.Text = "X"
  1158.             BooPosition3 = True
  1159.         Else
  1160.             BooWrongGuess = True
  1161.         End If
  1162.  
  1163.         If strWord.Substring(3, 1) = "X" Then
  1164.             lblPosition4.Text = "X"
  1165.             BooPosition4 = True
  1166.         Else
  1167.             BooWrongGuess = True
  1168.         End If
  1169.  
  1170.         If BooWrongGuess = True Then
  1171.             txtWrongGuesses.Text = txtWrongGuesses.Text & " X"
  1172.         End If
  1173.  
  1174.        If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1175.             BooWin = False
  1176.         Else
  1177.             BooWin = True
  1178.             MessageBox.Show("You Win!")
  1179.         End If
  1180.  
  1181.     End Sub
  1182.  
  1183.     Private Sub btnY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnY.Click
  1184.         btnY.Visible = False
  1185.  
  1186.         If strWord.Substring(0, 1) = "Y" Then
  1187.             lblPosition1.Text = "Y"
  1188.             BooPosition1 = True
  1189.         Else
  1190.             BooWrongGuess = True
  1191.         End If
  1192.  
  1193.         If strWord.Substring(1, 1) = "Y" Then
  1194.             lblPosition2.Text = "Y"
  1195.             BooPosition2 = True
  1196.         Else
  1197.             BooWrongGuess = True
  1198.         End If
  1199.  
  1200.         If strWord.Substring(2, 1) = "Y" Then
  1201.             lblPosition3.Text = "Y"
  1202.             BooPosition3 = True
  1203.         Else
  1204.             BooWrongGuess = True
  1205.         End If
  1206.  
  1207.         If strWord.Substring(3, 1) = "Y" Then
  1208.             lblPosition4.Text = "Y"
  1209.             BooPosition4 = True
  1210.         Else
  1211.             BooWrongGuess = True
  1212.         End If
  1213.  
  1214.         If BooWrongGuess = True Then
  1215.             txtWrongGuesses.Text = txtWrongGuesses.Text & " Y"
  1216.         End If
  1217.  
  1218.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1219.             BooWin = False
  1220.         Else
  1221.             BooWin = True
  1222.             MessageBox.Show("You Win!")
  1223.         End If
  1224.  
  1225.     End Sub
  1226.  
  1227.     Private Sub btnZ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZ.Click
  1228.         btnZ.Visible = False
  1229.         BooWrongGuess = False
  1230.  
  1231.         If strWord.Substring(0, 1) = "Z" Then
  1232.             lblPosition1.Text = "Z"
  1233.             BooPosition1 = True
  1234.             BooWrongGuess = False
  1235.         Else
  1236.             BooWrongGuess = True
  1237.         End If
  1238.  
  1239.         If strWord.Substring(1, 1) = "Z" Then
  1240.             lblPosition2.Text = "Z"
  1241.             BooPosition2 = True
  1242.             BooWrongGuess = False
  1243.         Else
  1244.             BooWrongGuess = True
  1245.         End If
  1246.  
  1247.         If strWord.Substring(2, 1) = "Z" Then
  1248.             lblPosition3.Text = "Z"
  1249.             BooPosition3 = True
  1250.             BooWrongGuess = False
  1251.         Else
  1252.             BooWrongGuess = True
  1253.         End If
  1254.  
  1255.         If strWord.Substring(3, 1) = "Z" Then
  1256.             lblPosition4.Text = "Z"
  1257.             BooPosition4 = True
  1258.             BooWrongGuess = False
  1259.         Else
  1260.             BooWrongGuess = True
  1261.         End If
  1262.  
  1263.         If BooWrongGuess = True Then
  1264.             txtWrongGuesses.Text = txtWrongGuesses.Text & " Z"
  1265.         End If
  1266.  
  1267.         If lblPosition1.Text = ("") Or lblPosition2.Text = ("") Or lblPosition3.Text = ("") Or lblPosition4.Text = ("") Then
  1268.             BooWin = False
  1269.         Else
  1270.             BooWin = True
  1271.             MessageBox.Show("You Win!")
  1272.         End If
  1273.  
  1274.     End Sub
  1275. End Class
Advertisement
Add Comment
Please, Sign In to add comment