can download program at http://www.sharebees.com/w9ahj4ipdth4.html [code] Public
ID: 3638740 • Letter: C
Question
can download program at
http://www.sharebees.com/w9ahj4ipdth4.html
[code]
Public Class Form1
Inherits System.Windows.Forms.Form
Dim theWord As String
Dim arrayWord(8) As String
Dim wrongGuess As Integer
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents txtWord As System.Windows.Forms.TextBox
Friend WithEvents lblWrong As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents lblWord As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents btnA As System.Windows.Forms.Button
Friend WithEvents btnB As System.Windows.Forms.Button
Friend WithEvents btnc As System.Windows.Forms.Button
Friend WithEvents btnD As System.Windows.Forms.Button
Friend WithEvents btnGo As System.Windows.Forms.Button
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents btnE As System.Windows.Forms.Button
Friend WithEvents btnF As System.Windows.Forms.Button
Friend WithEvents btnG As System.Windows.Forms.Button
Friend WithEvents btnH As System.Windows.Forms.Button
Friend WithEvents btnI As System.Windows.Forms.Button
Friend WithEvents btnJ As System.Windows.Forms.Button
Friend WithEvents btnK As System.Windows.Forms.Button
Friend WithEvents btnL As System.Windows.Forms.Button
Friend WithEvents btnM As System.Windows.Forms.Button
Friend WithEvents btnN As System.Windows.Forms.Button
Friend WithEvents btnO As System.Windows.Forms.Button
Friend WithEvents btnP As System.Windows.Forms.Button
Friend WithEvents btnQ As System.Windows.Forms.Button
Friend WithEvents btnR As System.Windows.Forms.Button
Friend WithEvents btnS As System.Windows.Forms.Button
Friend WithEvents btnT As System.Windows.Forms.Button
Friend WithEvents btnU As System.Windows.Forms.Button
Friend WithEvents btnV As System.Windows.Forms.Button
Friend WithEvents btnW As System.Windows.Forms.Button
Friend WithEvents btnX As System.Windows.Forms.Button
Friend WithEvents btnY As System.Windows.Forms.Button
Friend WithEvents btnZ As System.Windows.Forms.Button
Friend WithEvents btnAgain As System.Windows.Forms.Button
Friend WithEvents lblWrongcount As System.Windows.Forms.Label
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents pb1 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox6 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox7 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox8 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox9 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox10 As System.Windows.Forms.PictureBox
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.txtWord = New System.Windows.Forms.TextBox
Me.lblWrong = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.btnAgain = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.lblWord = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.btnA = New System.Windows.Forms.Button
Me.btnB = New System.Windows.Forms.Button
Me.btnc = New System.Windows.Forms.Button
Me.btnD = New System.Windows.Forms.Button
Me.btnE = New System.Windows.Forms.Button
Me.btnF = New System.Windows.Forms.Button
Me.btnG = New System.Windows.Forms.Button
Me.btnH = New System.Windows.Forms.Button
Me.btnI = New System.Windows.Forms.Button
Me.btnJ = New System.Windows.Forms.Button
Me.btnK = New System.Windows.Forms.Button
Me.btnL = New System.Windows.Forms.Button
Me.btnM = New System.Windows.Forms.Button
Me.btnN = New System.Windows.Forms.Button
Me.btnO = New System.Windows.Forms.Button
Me.btnP = New System.Windows.Forms.Button
Me.btnQ = New System.Windows.Forms.Button
Me.btnR = New System.Windows.Forms.Button
Me.btnS = New System.Windows.Forms.Button
Me.btnT = New System.Windows.Forms.Button
Me.btnU = New System.Windows.Forms.Button
Me.btnV = New System.Windows.Forms.Button
Me.btnW = New System.Windows.Forms.Button
Me.btnX = New System.Windows.Forms.Button
Me.btnY = New System.Windows.Forms.Button
Me.btnZ = New System.Windows.Forms.Button
Me.btnGo = New System.Windows.Forms.Button
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.lblWrongcount = New System.Windows.Forms.Label
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.pb1 = New System.Windows.Forms.PictureBox
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.PictureBox3 = New System.Windows.Forms.PictureBox
Me.PictureBox4 = New System.Windows.Forms.PictureBox
Me.PictureBox5 = New System.Windows.Forms.PictureBox
Me.PictureBox6 = New System.Windows.Forms.PictureBox
Me.PictureBox7 = New System.Windows.Forms.PictureBox
Me.PictureBox8 = New System.Windows.Forms.PictureBox
Me.PictureBox9 = New System.Windows.Forms.PictureBox
Me.PictureBox10 = New System.Windows.Forms.PictureBox
Me.SuspendLayout()
'
'txtWord
'
Me.txtWord.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtWord.Location = New System.Drawing.Point(176, 8)
Me.txtWord.MaxLength = 8
Me.txtWord.Name = "txtWord"
Me.txtWord.PasswordChar = Microsoft.VisualBasic.ChrW(8226)
Me.txtWord.Size = New System.Drawing.Size(112, 29)
Me.txtWord.TabIndex = 0
Me.txtWord.Text = ""
'
'lblWrong
'
Me.lblWrong.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblWrong.Font = New System.Drawing.Font("Courier New", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblWrong.Location = New System.Drawing.Point(16, 224)
Me.lblWrong.Name = "lblWrong"
Me.lblWrong.Size = New System.Drawing.Size(400, 40)
Me.lblWrong.TabIndex = 1
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 192)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(48, 23)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Wrong:"
'
'btnAgain
'
Me.btnAgain.Enabled = False
Me.btnAgain.Location = New System.Drawing.Point(336, 192)
Me.btnAgain.Name = "btnAgain"
Me.btnAgain.TabIndex = 3
Me.btnAgain.Text = "Play Again?"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(104, 8)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(63, 16)
Me.Label2.TabIndex = 4
Me.Label2.Text = "Type Word:"
'
'lblWord
'
Me.lblWord.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblWord.Font = New System.Drawing.Font("Courier New", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblWord.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
Me.lblWord.Location = New System.Drawing.Point(176, 144)
Me.lblWord.Name = "lblWord"
Me.lblWord.Size = New System.Drawing.Size(176, 32)
Me.lblWord.TabIndex = 5
Me.lblWord.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(80, 152)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(85, 22)
Me.Label3.TabIndex = 6
Me.Label3.Text = "The Word:"
'
'btnA
'
Me.btnA.Enabled = False
Me.btnA.Location = New System.Drawing.Point(8, 56)
Me.btnA.Name = "btnA"
Me.btnA.Size = New System.Drawing.Size(24, 23)
Me.btnA.TabIndex = 7
Me.btnA.Text = "A"
'
'btnB
'
Me.btnB.Enabled = False
Me.btnB.Location = New System.Drawing.Point(40, 56)
Me.btnB.Name = "btnB"
Me.btnB.Size = New System.Drawing.Size(24, 23)
Me.btnB.TabIndex = 8
Me.btnB.Text = "B"
'
'btnc
'
Me.btnc.Enabled = False
Me.btnc.Location = New System.Drawing.Point(72, 56)
Me.btnc.Name = "btnc"
Me.btnc.Size = New System.Drawing.Size(24, 23)
Me.btnc.TabIndex = 9
Me.btnc.Text = "C"
'
'btnD
'
Me.btnD.Enabled = False
Me.btnD.Location = New System.Drawing.Point(104, 56)
Me.btnD.Name = "btnD"
Me.btnD.Size = New System.Drawing.Size(24, 23)
Me.btnD.TabIndex = 10
Me.btnD.Text = "D"
'
'btnE
'
Me.btnE.Enabled = False
Me.btnE.Location = New System.Drawing.Point(136, 56)
Me.btnE.Name = "btnE"
Me.btnE.Size = New System.Drawing.Size(24, 23)
Me.btnE.TabIndex = 11
Me.btnE.Text = "E"
'
'btnF
'
Me.btnF.Enabled = False
Me.btnF.Location = New System.Drawing.Point(168, 56)
Me.btnF.Name = "btnF"
Me.btnF.Size = New System.Drawing.Size(24, 23)
Me.btnF.TabIndex = 12
Me.btnF.Text = "F"
'
'btnG
'
Me.btnG.Enabled = False
Me.btnG.Location = New System.Drawing.Point(200, 56)
Me.btnG.Name = "btnG"
Me.btnG.Size = New System.Drawing.Size(24, 23)
Me.btnG.TabIndex = 13
Me.btnG.Text = "G"
'
'btnH
'
Me.btnH.Enabled = False
Me.btnH.Location = New System.Drawing.Point(232, 56)
Me.btnH.Name = "btnH"
Me.btnH.Size = New System.Drawing.Size(24, 23)
Me.btnH.TabIndex = 14
Me.btnH.Text = "H"
'
'btnI
'
Me.btnI.Enabled = False
Me.btnI.Location = New System.Drawing.Point(264, 56)
Me.btnI.Name = "btnI"
Me.btnI.Size = New System.Drawing.Size(24, 23)
Me.btnI.TabIndex = 15
Me.btnI.Text = "I"
'
'btnJ
'
Me.btnJ.Enabled = False
Me.btnJ.Location = New System.Drawing.Point(296, 56)
Me.btnJ.Name = "btnJ"
Me.btnJ.Size = New System.Drawing.Size(24, 23)
Me.btnJ.TabIndex = 16
Me.btnJ.Text = "J"
'
'btnK
'
Me.btnK.Enabled = False
Me.btnK.Location = New System.Drawing.Point(328, 56)
Me.btnK.Name = "btnK"
Me.btnK.Size = New System.Drawing.Size(24, 23)
Me.btnK.TabIndex = 17
Me.btnK.Text = "K"
'
'btnL
'
Me.btnL.Enabled = False
Me.btnL.Location = New System.Drawing.Point(360, 56)
Me.btnL.Name = "btnL"
Me.btnL.Size = New System.Drawing.Size(24, 23)
Me.btnL.TabIndex = 18
Me.btnL.Text = "L"
'
'btnM
'
Me.btnM.Enabled = False
Me.btnM.Location = New System.Drawing.Point(392, 56)
Me.btnM.Name = "btnM"
Me.btnM.Size = New System.Drawing.Size(24, 23)
Me.btnM.TabIndex = 19
Me.btnM.Text = "M"
'
'btnN
'
Me.btnN.Enabled = False
Me.btnN.Location = New System.Drawing.Point(8, 88)
Me.btnN.Name = "btnN"
Me.btnN.Size = New System.Drawing.Size(24, 23)
Me.btnN.TabIndex = 20
Me.btnN.Text = "N"
'
'btnO
'
Me.btnO.Enabled = False
Me.btnO.Location = New System.Drawing.Point(40, 88)
Me.btnO.Name = "btnO"
Me.btnO.Size = New System.Drawing.Size(24, 23)
Me.btnO.TabIndex = 21
Me.btnO.Text = "O"
'
'btnP
'
Me.btnP.Enabled = False
Me.btnP.Location = New System.Drawing.Point(72, 88)
Me.btnP.Name = "btnP"
Me.btnP.Size = New System.Drawing.Size(24, 23)
Me.btnP.TabIndex = 22
Me.btnP.Text = "P"
'
'btnQ
'
Me.btnQ.Enabled = False
Me.btnQ.Location = New System.Drawing.Point(104, 88)
Me.btnQ.Name = "btnQ"
Me.btnQ.Size = New System.Drawing.Size(24, 23)
Me.btnQ.TabIndex = 23
Me.btnQ.Text = "Q"
'
'btnR
'
Me.btnR.Enabled = False
Me.btnR.Location = New System.Drawing.Point(136, 88)
Me.btnR.Name = "btnR"
Me.btnR.Size = New System.Drawing.Size(24, 23)
Me.btnR.TabIndex = 24
Me.btnR.Text = "R"
'
'btnS
'
Me.btnS.Enabled = False
Me.btnS.Location = New System.Drawing.Point(168, 88)
Me.btnS.Name = "btnS"
Me.btnS.Size = New System.Drawing.Size(24, 23)
Me.btnS.TabIndex = 25
Me.btnS.Text = "S"
'
'btnT
'
Me.btnT.Enabled = False
Me.btnT.Location = New System.Drawing.Point(200, 88)
Me.btnT.Name = "btnT"
Me.btnT.Size = New System.Drawing.Size(24, 23)
Me.btnT.TabIndex = 26
Me.btnT.Text = "T"
'
'btnU
'
Me.btnU.Enabled = False
Me.btnU.Location = New System.Drawing.Point(232, 88)
Me.btnU.Name = "btnU"
Me.btnU.Size = New System.Drawing.Size(24, 23)
Me.btnU.TabIndex = 27
Me.btnU.Text = "U"
'
'btnV
'
Me.btnV.Enabled = False
Me.btnV.Location = New System.Drawing.Point(264, 88)
Me.btnV.Name = "btnV"
Me.btnV.Size = New System.Drawing.Size(24, 23)
Me.btnV.TabIndex = 28
Me.btnV.Text = "V"
'
'btnW
'
Me.btnW.Enabled = False
Me.btnW.Location = New System.Drawing.Point(296, 88)
Me.btnW.Name = "btnW"
Me.btnW.Size = New System.Drawing.Size(24, 23)
Me.btnW.TabIndex = 29
Me.btnW.Text = "W"
'
'btnX
'
Me.btnX.Enabled = False
Me.btnX.Location = New System.Drawing.Point(328, 88)
Me.btnX.Name = "btnX"
Me.btnX.Size = New System.Drawing.Size(24, 23)
Me.btnX.TabIndex = 30
Me.btnX.Text = "X"
'
'btnY
'
Me.btnY.Enabled = False
Me.btnY.Location = New System.Drawing.Point(360, 88)
Me.btnY.Name = "btnY"
Me.btnY.Size = New System.Drawing.Size(24, 23)
Me.btnY.TabIndex = 31
Me.btnY.Text = "Y"
'
'btnZ
'
Me.btnZ.Enabled = False
Me.btnZ.Location = New System.Drawing.Point(392, 88)
Me.btnZ.Name = "btnZ"
Me.btnZ.Size = New System.Drawing.Size(24, 23)
Me.btnZ.TabIndex = 32
Me.btnZ.Text = "Z"
'
'btnGo
'
Me.btnGo.Location = New System.Drawing.Point(296, 8)
Me.btnGo.Name = "btnGo"
Me.btnGo.Size = New System.Drawing.Size(32, 23)
Me.btnGo.TabIndex = 33
Me.btnGo.Text = "Go"
'
'Label4
'
Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label4.Location = New System.Drawing.Point(8, 40)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(408, 1)
Me.Label4.TabIndex = 34
'
'Label5
'
Me.Label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label5.Location = New System.Drawing.Point(12, 133)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(408, 1)
Me.Label5.TabIndex = 35
'
'lblWrongcount
'
Me.lblWrongcount.Font = New System.Drawing.Font("Courier New", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblWrongcount.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
Me.lblWrongcount.Location = New System.Drawing.Point(64, 192)
Me.lblWrongcount.Name = "lblWrongcount"
Me.lblWrongcount.Size = New System.Drawing.Size(48, 24)
Me.lblWrongcount.TabIndex = 36
Me.lblWrongcount.Text = "0"
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(57, 57)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
'
'pb1
'
Me.pb1.Location = New System.Drawing.Point(160, 272)
Me.pb1.Name = "pb1"
Me.pb1.Size = New System.Drawing.Size(80, 64)
Me.pb1.TabIndex = 37
Me.pb1.TabStop = False
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(176, 336)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(24, 24)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 38
Me.PictureBox1.TabStop = False
'
'PictureBox2
'
Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
Me.PictureBox2.Location = New System.Drawing.Point(224, 352)
Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(24, 24)
Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox2.TabIndex = 39
Me.PictureBox2.TabStop = False
'
'PictureBox3
'
Me.PictureBox3.Image = CType(resources.GetObject("PictureBox3.Image"), System.Drawing.Image)
Me.PictureBox3.Location = New System.Drawing.Point(200, 352)
Me.PictureBox3.Name = "PictureBox3"
Me.PictureBox3.Size = New System.Drawing.Size(24, 24)
Me.PictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox3.TabIndex = 40
Me.PictureBox3.TabStop = False
'
'PictureBox4
'
Me.PictureBox4.Image = CType(resources.GetObject("PictureBox4.Image"), System.Drawing.Image)
Me.PictureBox4.Location = New System.Drawing.Point(152, 352)
Me.PictureBox4.Name = "PictureBox4"
Me.PictureBox4.Size = New System.Drawing.Size(24, 24)
Me.PictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox4.TabIndex = 41
Me.PictureBox4.TabStop = False
'
'PictureBox5
'
Me.PictureBox5.Image = CType(resources.GetObject("PictureBox5.Image"), System.Drawing.Image)
Me.PictureBox5.Location = New System.Drawing.Point(128, 352)
Me.PictureBox5.Name = "PictureBox5"
Me.PictureBox5.Size = New System.Drawing.Size(24, 24)
Me.PictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox5.TabIndex = 42
Me.PictureBox5.TabStop = False
'
'PictureBox6
'
Me.PictureBox6.Image = CType(resources.GetObject("PictureBox6.Image"), System.Drawing.Image)
Me.PictureBox6.Location = New System.Drawing.Point(176, 368)
Me.PictureBox6.Name = "PictureBox6"
Me.PictureBox6.Size = New System.Drawing.Size(24, 24)
Me.PictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox6.TabIndex = 43
Me.PictureBox6.TabStop = False
'
'PictureBox7
'
Me.PictureBox7.Image = CType(resources.GetObject("PictureBox7.Image"), System.Drawing.Image)
Me.PictureBox7.Location = New System.Drawing.Point(192, 392)
Me.PictureBox7.Name = "PictureBox7"
Me.PictureBox7.Size = New System.Drawing.Size(24, 24)
Me.PictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox7.TabIndex = 44
Me.PictureBox7.TabStop = False
'
'PictureBox8
'
Me.PictureBox8.Image = CType(resources.GetObject("PictureBox8.Image"), System.Drawing.Image)
Me.PictureBox8.Location = New System.Drawing.Point(160, 392)
Me.PictureBox8.Name = "PictureBox8"
Me.PictureBox8.Size = New System.Drawing.Size(24, 24)
Me.PictureBox8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox8.TabIndex = 45
Me.PictureBox8.TabStop = False
'
'PictureBox9
'
Me.PictureBox9.Image = CType(resources.GetObject("PictureBox9.Image"), System.Drawing.Image)
Me.PictureBox9.Location = New System.Drawing.Point(144, 416)
Me.PictureBox9.Name = "PictureBox9"
Me.PictureBox9.Size = New System.Drawing.Size(24, 24)
Me.PictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox9.TabIndex = 46
Me.PictureBox9.TabStop = False
'
'PictureBox10
'
Me.PictureBox10.Image = CType(resources.GetObject("PictureBox10.Image"), System.Drawing.Image)
Me.PictureBox10.Location = New System.Drawing.Point(200, 416)
Me.PictureBox10.Name = "PictureBox10"
Me.PictureBox10.Size = New System.Drawing.Size(24, 24)
Me.PictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox10.TabIndex = 47
Me.PictureBox10.TabStop = False
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(128, Byte))
Me.ClientSize = New System.Drawing.Size(440, 454)
Me.Controls.Add(Me.PictureBox10)
Me.Controls.Add(Me.PictureBox9)
Me.Controls.Add(Me.PictureBox8)
Me.Controls.Add(Me.PictureBox7)
Me.Controls.Add(Me.PictureBox6)
Me.Controls.Add(Me.PictureBox5)
Me.Controls.Add(Me.PictureBox4)
Me.Controls.Add(Me.PictureBox3)
Me.Controls.Add(Me.PictureBox2)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.pb1)
Me.Controls.Add(Me.lblWrongcount)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.btnGo)
Me.Controls.Add(Me.btnZ)
Me.Controls.Add(Me.btnY)
Me.Controls.Add(Me.btnX)
Me.Controls.Add(Me.btnW)
Me.Controls.Add(Me.btnV)
Me.Controls.Add(Me.btnU)
Me.Controls.Add(Me.btnT)
Me.Controls.Add(Me.btnS)
Me.Controls.Add(Me.btnR)
Me.Controls.Add(Me.btnQ)
Me.Controls.Add(Me.btnP)
Me.Controls.Add(Me.btnO)
Me.Controls.Add(Me.btnN)
Me.Controls.Add(Me.btnM)
Me.Controls.Add(Me.btnL)
Me.Controls.Add(Me.btnK)
Me.Controls.Add(Me.btnJ)
Me.Controls.Add(Me.btnI)
Me.Controls.Add(Me.btnH)
Me.Controls.Add(Me.btnG)
Me.Controls.Add(Me.btnF)
Me.Controls.Add(Me.btnE)
Me.Controls.Add(Me.btnD)
Me.Controls.Add(Me.btnc)
Me.Controls.Add(Me.btnB)
Me.Controls.Add(Me.btnA)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.lblWord)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.btnAgain)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.lblWrong)
Me.Controls.Add(Me.txtWord)
Me.Name = "Form1"
Me.Text = "HangMan"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
wrongGuess = 0 ' reset wrong guesses
pb1.Image = ImageList1.Images(0)
If Len(txtWord.Text) = 0 Then
MessageBox.Show("You must enter a word", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
Else
Call enableAll() ' enable all letters
ReDim arrayWord(Len(txtWord.Text))
End If
theWord = UCase(txtWord.Text)
Dim x As Integer
lblWord.Text = ""
For x = 1 To Len(theWord)
lblWord.Text += "?"
arrayWord(x) = "?"
Next
btnGo.Enabled = False
End Sub
Private Sub btnA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnA.Click
guess(btnA.Text)
btnA.Visible = False
End Sub
Public Sub guess(ByVal letter As String)
lblWord.Text = ""
Dim goodFlag As Boolean = False
Dim x As Integer
Dim winFlag As Boolean = True
' check to see if the letter fits
For x = 1 To Len(theWord)
If letter = Mid(theWord, x, 1) Then
arrayWord(x) = letter
goodFlag = True
End If
lblWord.Text += arrayWord(x)
Next
' see if its a winner or not
For x = 1 To Len(theWord)
If "?" = arrayWord(x) Then
winFlag = False
Exit For
End If
Next
If winFlag = True Then
MessageBox.Show("YOU WIN!!!!", "A WINNER!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
btnAgain.Enabled = True
disableAll()
Exit Sub
End If
' put the letter in if correct
If goodFlag = False Then
lblWrong.Text += " " & letter
Call SubwrongGuess()
End If
End Sub
Public Sub SubwrongGuess()
wrongGuess += 1
lblWrongcount.Text = wrongGuess
If wrongGuess = 1 Then PictureBox10.Visible = False
If wrongGuess = 2 Then PictureBox9.Visible = False
If wrongGuess = 3 Then PictureBox8.Visible = False
If wrongGuess = 4 Then PictureBox7.Visible = False
If wrongGuess = 5 Then PictureBox6.Visible = False
If wrongGuess = 5 Then pb1.Image = ImageList1.Images(1)
If wrongGuess = 6 Then PictureBox5.Visible = False
If wrongGuess = 7 Then PictureBox4.Visible = False
If wrongGuess = 8 Then PictureBox3.Visible = False
If wrongGuess = 9 Then PictureBox2.Visible = False
If wrongGuess = 10 Then PictureBox1.Visible = False
If wrongGuess = 10 Then pb1.Image = ImageList1.Images(2)
If wrongGuess = 11 Then
pb1.Image = ImageList1.Images(3)
Call disableAll()
MessageBox.Show("You loose...")
End If
End Sub
Public Sub ResetAll()
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
btnGo.Enabled = True
txtWord.Text = ""
txtWord.Focus()
lblWord.Text = ""
Call disableAll()
lblWrongcount.Text = "0"
lblWrong.Text = ""
pb1.Image = ImageList1.Images(0)
PictureBox1.Visible = True
PictureBox2.Visible = True
PictureBox3.Visible = True
PictureBox4.Visible = True
PictureBox5.Visible = True
PictureBox6.Visible = True
PictureBox7.Visible = True
PictureBox8.Visible = True
PictureBox9.Visible = True
PictureBox10.Visible = True
End Sub
Public Sub enableAll()
btnA.Enabled = True
btnB.Enabled = True
btnc.Enabled = True
btnD.Enabled = True
btnE.Enabled = True
btnF.Enabled = True
btnG.Enabled = True
btnH.Enabled = True
btnI.Enabled = True
btnJ.Enabled = True
btnK.Enabled = True
btnL.Enabled = True
btnM.Enabled = True
btnN.Enabled = True
btnO.Enabled = True
btnP.Enabled = True
btnQ.Enabled = True
btnR.Enabled = True
btnS.Enabled = True
btnT.Enabled = True
btnU.Enabled = True
btnV.Enabled = True
btnW.Enabled = True
btnX.Enabled = True
btnY.Enabled = True
btnZ.Enabled = True
End Sub
Public Sub disableAll()
btnA.Enabled = False
btnB.Enabled = False
btnc.Enabled = False
btnD.Enabled = False
btnE.Enabled = False
btnF.Enabled = False
btnG.Enabled = False
btnH.Enabled = False
btnI.Enabled = False
btnJ.Enabled = False
btnK.Enabled = False
btnL.Enabled = False
btnM.Enabled = False
btnN.Enabled = False
btnO.Enabled = False
btnP.Enabled = False
btnQ.Enabled = False
btnR.Enabled = False
btnS.Enabled = False
btnT.Enabled = False
btnU.Enabled = False
btnV.Enabled = False
btnW.Enabled = False
btnX.Enabled = False
btnY.Enabled = False
btnZ.Enabled = False
End Sub
Private Sub btnB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnB.Click
guess(btnB.Text)
btnB.Visible = False
End Sub
Private Sub btnc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnc.Click
guess(btnc.Text)
btnc.Visible = False
End Sub
Private Sub btnD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnD.Click
guess(btnD.Text)
btnD.Visible = False
End Sub
Private Sub btnE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnE.Click
guess(btnE.Text)
btnE.Visible = False
End Sub
Private Sub btnF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF.Click
guess(btnF.Text)
btnF.Visible = False
End Sub
Private Sub btnG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnG.Click
guess(btnG.Text)
btnG.Visible = False
End Sub
Private Sub btnH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnH.Click
guess(btnH.Text)
btnH.Visible = False
End Sub
Private Sub btnI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnI.Click
guess(btnI.Text)
btnI.Visible = False
End Sub
Private Sub btnJ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnJ.Click
guess(btnJ.Text)
btnJ.Visible = False
End Sub
Private Sub btnK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnK.Click
guess(btnK.Text)
btnK.Visible = False
End Sub
Private Sub btnL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnL.Click
guess(btnL.Text)
btnL.Visible = False
End Sub
Private Sub btnM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnM.Click
guess(btnM.Text)
btnM.Visible = False
End Sub
Private Sub btnN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnN.Click
guess(btnN.Text)
btnN.Visible = False
End Sub
Private Sub btnO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnO.Click
guess(btnO.Text)
btnO.Visible = False
End Sub
Private Sub btnP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnP.Click
guess(btnP.Text)
btnP.Visible = False
End Sub
Private Sub btnQ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQ.Click
guess(btnQ.Text)
btnQ.Visible = False
End Sub
Private Sub btnR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnR.Click
guess(btnR.Text)
btnR.Visible = False
End Sub
Private Sub btnS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnS.Click
guess(btnS.Text)
btnS.Visible = False
End Sub
Private Sub btnT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnT.Click
guess(btnT.Text)
btnT.Visible = False
End Sub
Private Sub btnU_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnU.Click
guess(btnU.Text)
btnU.Visible = False
End Sub
Private Sub btnV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnV.Click
guess(btnV.Text)
btnV.Visible = False
End Sub
Private Sub btnW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnW.Click
guess(btnW.Text)
btnW.Visible = False
End Sub
Private Sub btnX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnX.Click
guess(btnX.Text)
btnX.Visible = False
End Sub
Private Sub btnY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnY.Click
guess(btnY.Text)
btnY.Visible = False
End Sub
Private Sub btnZ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZ.Click
guess(btnZ.Text)
btnZ.Visible = False
End Sub
Private Sub btnAgain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAgain.Click
Call ResetAll()
btnAgain.Enabled = False ' disable play again until game over
End Sub
End Class
[code/]
General (Declaration) Call ResetAll() btnAgain-Enabled False disable play again until game over End Sub E Private sub Form1 Load (Byval sender As system object, Byval e As system. Dim my path As String path Application Startuppath MessageBox.Show(mypath) my path my path & Tidictionary.txt" Message Box Show path Fileopen(1, my path, openMode. Input) End Sub End ClassExplanation / Answer
Private Sub btnE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnE.Click guess(btnE.Text) btnE.Visible = False End Sub Private Sub btnF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF.Click guess(btnF.Text) btnF.Visible = False End Sub Private Sub btnG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnG.Click guess(btnG.Text) btnG.Visible = False End Sub Private Sub btnH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnH.Click guess(btnH.Text) btnH.Visible = False End Sub Private Sub btnI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnI.Click guess(btnI.Text) btnI.Visible = False End Sub Private Sub btnJ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnJ.Click guess(btnJ.Text) btnJ.Visible = False End Sub
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.