home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1153611102000.psc / frmGame.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-10-16  |  27.2 KB  |  968 lines

  1. VERSION 5.00
  2. Begin VB.Form frmGame 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "The Hangman Game"
  5.    ClientHeight    =   5295
  6.    ClientLeft      =   1545
  7.    ClientTop       =   1410
  8.    ClientWidth     =   7095
  9.    Icon            =   "frmGame.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   5295
  13.    ScaleWidth      =   7095
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.Timer tmrRandom 
  16.       Interval        =   10
  17.       Left            =   240
  18.       Top             =   240
  19.    End
  20.    Begin VB.TextBox txtGuess 
  21.       Height          =   285
  22.       Left            =   2280
  23.       TabIndex        =   38
  24.       Text            =   "Text1"
  25.       Top             =   5880
  26.       Visible         =   0   'False
  27.       Width           =   855
  28.    End
  29.    Begin VB.Frame fraPlay 
  30.       Height          =   5175
  31.       Left            =   120
  32.       TabIndex        =   0
  33.       Top             =   0
  34.       Visible         =   0   'False
  35.       Width           =   6855
  36.       Begin VB.Timer tmrChooseWord 
  37.          Enabled         =   0   'False
  38.          Interval        =   50
  39.          Left            =   600
  40.          Top             =   240
  41.       End
  42.       Begin VB.Frame fraInfo 
  43.          Caption         =   "Game Information:"
  44.          Height          =   855
  45.          Left            =   2520
  46.          TabIndex        =   33
  47.          Top             =   1440
  48.          Width           =   3975
  49.          Begin VB.Label labWrong 
  50.             Alignment       =   2  'Center
  51.             Caption         =   "0"
  52.             Height          =   255
  53.             Left            =   2400
  54.             TabIndex        =   37
  55.             Top             =   480
  56.             Width           =   975
  57.          End
  58.          Begin VB.Label Label3 
  59.             Caption         =   "Wrong clicks"
  60.             Height          =   255
  61.             Left            =   2400
  62.             TabIndex        =   36
  63.             Top             =   240
  64.             Width           =   975
  65.          End
  66.          Begin VB.Label labTotal 
  67.             Alignment       =   2  'Center
  68.             Caption         =   "0"
  69.             Height          =   255
  70.             Left            =   600
  71.             TabIndex        =   35
  72.             Top             =   480
  73.             Width           =   855
  74.          End
  75.          Begin VB.Label Label2 
  76.             Caption         =   "Total clicks"
  77.             Height          =   255
  78.             Left            =   600
  79.             TabIndex        =   34
  80.             Top             =   240
  81.             Width           =   855
  82.          End
  83.       End
  84.       Begin VB.Frame Frame2 
  85.          Caption         =   "Click a letter in this box to guess a letter:"
  86.          Height          =   1095
  87.          Left            =   2520
  88.          TabIndex        =   5
  89.          Top             =   3840
  90.          Width           =   3975
  91.          Begin VB.Label P 
  92.             Caption         =   "P"
  93.             Height          =   255
  94.             Left            =   3000
  95.             TabIndex        =   31
  96.             Top             =   240
  97.             Width           =   135
  98.          End
  99.          Begin VB.Label L 
  100.             Caption         =   "L"
  101.             Height          =   255
  102.             Left            =   2880
  103.             TabIndex        =   30
  104.             Top             =   480
  105.             Width           =   135
  106.          End
  107.          Begin VB.Label K 
  108.             Caption         =   "K"
  109.             Height          =   255
  110.             Left            =   2640
  111.             TabIndex        =   29
  112.             Top             =   480
  113.             Width           =   135
  114.          End
  115.          Begin VB.Label O 
  116.             Caption         =   "O"
  117.             Height          =   255
  118.             Left            =   2760
  119.             TabIndex        =   28
  120.             Top             =   240
  121.             Width           =   135
  122.          End
  123.          Begin VB.Label I 
  124.             Caption         =   "I"
  125.             Height          =   255
  126.             Left            =   2520
  127.             TabIndex        =   27
  128.             Top             =   240
  129.             Width           =   135
  130.          End
  131.          Begin VB.Label J 
  132.             Caption         =   "J"
  133.             Height          =   255
  134.             Left            =   2400
  135.             TabIndex        =   26
  136.             Top             =   480
  137.             Width           =   135
  138.          End
  139.          Begin VB.Label H 
  140.             Caption         =   "H"
  141.             Height          =   255
  142.             Left            =   2160
  143.             TabIndex        =   25
  144.             Top             =   480
  145.             Width           =   135
  146.          End
  147.          Begin VB.Label U 
  148.             Caption         =   "U"
  149.             Height          =   255
  150.             Left            =   2280
  151.             TabIndex        =   24
  152.             Top             =   240
  153.             Width           =   135
  154.          End
  155.          Begin VB.Label M 
  156.             Caption         =   "M"
  157.             Height          =   255
  158.             Left            =   2520
  159.             TabIndex        =   23
  160.             Top             =   720
  161.             Width           =   135
  162.          End
  163.          Begin VB.Label G 
  164.             Caption         =   "G"
  165.             Height          =   255
  166.             Left            =   1920
  167.             TabIndex        =   22
  168.             Top             =   480
  169.             Width           =   135
  170.          End
  171.          Begin VB.Label Y 
  172.             Caption         =   "Y"
  173.             Height          =   255
  174.             Left            =   2040
  175.             TabIndex        =   21
  176.             Top             =   240
  177.             Width           =   135
  178.          End
  179.          Begin VB.Label T 
  180.             Caption         =   "T"
  181.             Height          =   255
  182.             Left            =   1800
  183.             TabIndex        =   20
  184.             Top             =   240
  185.             Width           =   135
  186.          End
  187.          Begin VB.Label N 
  188.             Caption         =   "N"
  189.             Height          =   255
  190.             Left            =   2280
  191.             TabIndex        =   19
  192.             Top             =   720
  193.             Width           =   135
  194.          End
  195.          Begin VB.Label R 
  196.             Caption         =   "R"
  197.             Height          =   255
  198.             Left            =   1560
  199.             TabIndex        =   18
  200.             Top             =   240
  201.             Width           =   135
  202.          End
  203.          Begin VB.Label V 
  204.             Caption         =   "V"
  205.             Height          =   255
  206.             Left            =   1800
  207.             TabIndex        =   17
  208.             Top             =   720
  209.             Width           =   135
  210.          End
  211.          Begin VB.Label X 
  212.             Caption         =   "X"
  213.             Height          =   255
  214.             Left            =   1320
  215.             TabIndex        =   16
  216.             Top             =   720
  217.             Width           =   135
  218.          End
  219.          Begin VB.Label S 
  220.             Caption         =   "S"
  221.             Height          =   255
  222.             Left            =   1200
  223.             TabIndex        =   15
  224.             Top             =   480
  225.             Width           =   135
  226.          End
  227.          Begin VB.Label W 
  228.             Caption         =   "W"
  229.             Height          =   255
  230.             Left            =   1080
  231.             TabIndex        =   14
  232.             Top             =   240
  233.             Width           =   255
  234.          End
  235.          Begin VB.Label Z 
  236.             Caption         =   "Z"
  237.             Height          =   255
  238.             Left            =   1080
  239.             TabIndex        =   13
  240.             Top             =   720
  241.             Width           =   135
  242.          End
  243.          Begin VB.Label Q 
  244.             Caption         =   "Q"
  245.             Height          =   255
  246.             Left            =   840
  247.             TabIndex        =   12
  248.             Top             =   240
  249.             Width           =   135
  250.          End
  251.          Begin VB.Label F 
  252.             Caption         =   "F"
  253.             Height          =   255
  254.             Left            =   1680
  255.             TabIndex        =   11
  256.             Top             =   480
  257.             Width           =   135
  258.          End
  259.          Begin VB.Label E 
  260.             Caption         =   "E"
  261.             Height          =   255
  262.             Left            =   1320
  263.             TabIndex        =   10
  264.             Top             =   240
  265.             Width           =   135
  266.          End
  267.          Begin VB.Label D 
  268.             Caption         =   "D"
  269.             Height          =   255
  270.             Left            =   1440
  271.             TabIndex        =   9
  272.             Top             =   480
  273.             Width           =   135
  274.          End
  275.          Begin VB.Label C 
  276.             Caption         =   "C"
  277.             Height          =   255
  278.             Left            =   1560
  279.             TabIndex        =   8
  280.             Top             =   720
  281.             Width           =   135
  282.          End
  283.          Begin VB.Label B 
  284.             Caption         =   "B"
  285.             Height          =   255
  286.             Left            =   2040
  287.             TabIndex        =   7
  288.             Top             =   720
  289.             Width           =   135
  290.          End
  291.          Begin VB.Label A 
  292.             Caption         =   "A"
  293.             Height          =   255
  294.             Left            =   960
  295.             TabIndex        =   6
  296.             Top             =   480
  297.             Width           =   135
  298.          End
  299.       End
  300.       Begin VB.Frame fraword 
  301.          Caption         =   "Hidden word:"
  302.          Height          =   855
  303.          Left            =   2520
  304.          TabIndex        =   3
  305.          Top             =   360
  306.          Width           =   3975
  307.          Begin VB.Label labWord 
  308.             Alignment       =   2  'Center
  309.             BeginProperty Font 
  310.                Name            =   "MS Sans Serif"
  311.                Size            =   12
  312.                Charset         =   0
  313.                Weight          =   400
  314.                Underline       =   0   'False
  315.                Italic          =   0   'False
  316.                Strikethrough   =   0   'False
  317.             EndProperty
  318.             Height          =   495
  319.             Left            =   120
  320.             TabIndex        =   4
  321.             Top             =   240
  322.             Width           =   3735
  323.          End
  324.       End
  325.       Begin VB.Frame frame 
  326.          Caption         =   "Letters clicked:"
  327.          Height          =   1095
  328.          Left            =   2520
  329.          TabIndex        =   1
  330.          Top             =   2520
  331.          Width           =   3975
  332.          Begin VB.Label labOutput 
  333.             Height          =   735
  334.             Left            =   120
  335.             TabIndex        =   2
  336.             Top             =   240
  337.             Width           =   3735
  338.          End
  339.       End
  340.       Begin VB.Label lblcword 
  341.          Height          =   255
  342.          Left            =   360
  343.          TabIndex        =   40
  344.          Top             =   4680
  345.          Visible         =   0   'False
  346.          Width           =   1815
  347.       End
  348.       Begin VB.Label labRandom 
  349.          Height          =   375
  350.          Left            =   480
  351.          TabIndex        =   39
  352.          Top             =   4320
  353.          Visible         =   0   'False
  354.          Width           =   1215
  355.       End
  356.       Begin VB.Line support 
  357.          Visible         =   0   'False
  358.          X1              =   1200
  359.          X2              =   840
  360.          Y1              =   1200
  361.          Y2              =   1560
  362.       End
  363.       Begin VB.Line larm 
  364.          Visible         =   0   'False
  365.          X1              =   1200
  366.          X2              =   1680
  367.          Y1              =   1680
  368.          Y2              =   2160
  369.       End
  370.       Begin VB.Line rarm 
  371.          Visible         =   0   'False
  372.          X1              =   1680
  373.          X2              =   2160
  374.          Y1              =   2160
  375.          Y2              =   1680
  376.       End
  377.       Begin VB.Line rleg 
  378.          Visible         =   0   'False
  379.          X1              =   1680
  380.          X2              =   2040
  381.          Y1              =   2760
  382.          Y2              =   3240
  383.       End
  384.       Begin VB.Line lleg 
  385.          Visible         =   0   'False
  386.          X1              =   1680
  387.          X2              =   1320
  388.          Y1              =   2760
  389.          Y2              =   3240
  390.       End
  391.       Begin VB.Line body 
  392.          Visible         =   0   'False
  393.          X1              =   1680
  394.          X2              =   1680
  395.          Y1              =   2760
  396.          Y2              =   1920
  397.       End
  398.       Begin VB.Shape head 
  399.          Height          =   495
  400.          Left            =   1320
  401.          Shape           =   3  'Circle
  402.          Top             =   1440
  403.          Visible         =   0   'False
  404.          Width           =   735
  405.       End
  406.       Begin VB.Line rope 
  407.          Visible         =   0   'False
  408.          X1              =   1680
  409.          X2              =   1680
  410.          Y1              =   1440
  411.          Y2              =   1200
  412.       End
  413.       Begin VB.Line pole2 
  414.          Visible         =   0   'False
  415.          X1              =   1680
  416.          X2              =   840
  417.          Y1              =   1200
  418.          Y2              =   1200
  419.       End
  420.       Begin VB.Line pole 
  421.          Visible         =   0   'False
  422.          X1              =   840
  423.          X2              =   840
  424.          Y1              =   3600
  425.          Y2              =   1200
  426.       End
  427.       Begin VB.Line Ground 
  428.          Visible         =   0   'False
  429.          X1              =   480
  430.          X2              =   1920
  431.          Y1              =   3600
  432.          Y2              =   3600
  433.       End
  434.    End
  435.    Begin VB.Label Label1 
  436.       Caption         =   "To play click New Game from the file menu"
  437.       Height          =   255
  438.       Left            =   120
  439.       TabIndex        =   32
  440.       Top             =   120
  441.       Width           =   3135
  442.    End
  443.    Begin VB.Menu mnuGame 
  444.       Caption         =   "&Game"
  445.       Begin VB.Menu mnuNew 
  446.          Caption         =   "&New Game"
  447.          Shortcut        =   {F2}
  448.       End
  449.       Begin VB.Menu mnuStop 
  450.          Caption         =   "&Stop Game"
  451.          Enabled         =   0   'False
  452.       End
  453.       Begin VB.Menu mnuResume 
  454.          Caption         =   "&Resume Game"
  455.          Enabled         =   0   'False
  456.       End
  457.       Begin VB.Menu mnuSep1 
  458.          Caption         =   "-"
  459.       End
  460.       Begin VB.Menu mnuAddWord 
  461.          Caption         =   "&Add Word"
  462.       End
  463.       Begin VB.Menu mnuChooseWord 
  464.          Caption         =   "&Choose Word"
  465.       End
  466.       Begin VB.Menu mnuSep2 
  467.          Caption         =   "-"
  468.       End
  469.       Begin VB.Menu mnuExit 
  470.          Caption         =   "E&xit"
  471.       End
  472.    End
  473.    Begin VB.Menu mnuHelp 
  474.       Caption         =   "&Help"
  475.       Begin VB.Menu mnuRegister 
  476.          Caption         =   "&Register"
  477.       End
  478.       Begin VB.Menu mnuAbout 
  479.          Caption         =   "&About"
  480.       End
  481.    End
  482. Attribute VB_Name = "frmGame"
  483. Attribute VB_GlobalNameSpace = False
  484. Attribute VB_Creatable = False
  485. Attribute VB_PredeclaredId = True
  486. Attribute VB_Exposed = False
  487. Option Explicit
  488. Dim Registered As Boolean
  489. Dim MyGuess As String
  490. Dim Guessed As String
  491. Dim Word As String
  492. Dim cWord
  493. Dim wrong As Single
  494. Dim template As String
  495. Dim Answer As String
  496. Dim endword As String
  497. Dim chance, num As Byte
  498. Private Sub cmdExit_Click()
  499.     End
  500. End Sub
  501. Public Sub letters(MyGuess As String)
  502.     Dim numWords As Integer
  503.     Dim Chooseword As Integer
  504.     Dim OldTemplate As String
  505.     Dim C As String
  506.     Dim num As String
  507.     Dim wordlenth As Integer
  508.     Dim II As Single
  509.     Guessed = labOutput.Caption
  510.     OldTemplate = template
  511.     For II = 1 To Len(Word)
  512.         C = Mid(Word, II, 1)
  513.         If C = MyGuess Then
  514.             Mid(template, II, 1) = C
  515.         End If
  516.     Next II
  517.     chance = chance + 1
  518.     labTotal = labTotal + 1
  519.     labWord.Caption = template
  520.     labOutput.Caption = labOutput.Caption + " " + MyGuess
  521.     If OldTemplate = template Then
  522.         wrong = wrong + 1
  523.         labWrong = wrong
  524.         labOutput.Caption = Guessed & " " & MyGuess
  525.         If wrong = 1 Then Ground.Visible = True
  526.         If wrong = 2 Then pole.Visible = True
  527.         If wrong = 3 Then pole2.Visible = True
  528.         If wrong = 4 Then support.Visible = True
  529.         If wrong = 5 Then rope.Visible = True
  530.         If wrong = 6 Then head.Visible = True
  531.         If wrong = 7 Then body.Visible = True
  532.         If wrong = 8 Then rleg.Visible = True
  533.         If wrong = 9 Then lleg.Visible = True
  534.         If wrong = 10 Then rarm.Visible = True
  535.         If wrong = 11 Then larm.Visible = True
  536.     End If
  537.      If wrong = 12 Then
  538.         Load frmDead
  539.         frmDead.Show
  540.         wrong = 0
  541.     End If
  542. End Sub
  543. Private Sub A_Click()
  544.     Dim MyGuess As String
  545.     A.Visible = False
  546.     MyGuess = A
  547.     letters (MyGuess)
  548. End Sub
  549. Private Sub B_Click()
  550.     Dim MyGuess As String
  551.     B.Visible = False
  552.     MyGuess = B
  553.     letters (MyGuess)
  554. End Sub
  555. Private Sub C_Click()
  556.     Dim MyGuess As String
  557.     C.Visible = False
  558.     MyGuess = C
  559.     letters (MyGuess)
  560. End Sub
  561. Private Sub D_Click()
  562.     Dim MyGuess As String
  563.     D.Visible = False
  564.     MyGuess = D
  565.     letters (MyGuess)
  566. End Sub
  567. Private Sub E_Click()
  568.     Dim MyGuess As String
  569.     E.Visible = False
  570.     MyGuess = E
  571.     letters (MyGuess)
  572. End Sub
  573. Private Sub F_Click()
  574.     Dim MyGuess As String
  575.     F.Visible = False
  576.     MyGuess = F
  577.     letters (MyGuess)
  578. End Sub
  579. Private Sub Form_Load()
  580.     Dim OpenTimes As String
  581.     Dim UsedTimes As String
  582.     Dim NewOpenTimes As String
  583.     Dim Path As String
  584.     Dim Start As String
  585.     Dim RegKey As String
  586.     Dim RegTo As String
  587.     Load frmAbout
  588.     frmAbout.Hide
  589.     UsedTimes = "VBHM"
  590.     Start = "10"
  591.     Path = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion"
  592.     OpenTimes = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion", "VBHM")
  593.     RegTo = GetStringValue("HKEY_LOCAL_MACHINE\Software\CipherSoftware\Hangman", "RegTo")
  594.     RegKey = GetStringValue("HKEY_LOCAL_MACHINE\Software\CipherSoftware\Hangman", "RegKey")
  595.     If RegKey = "CSIOPFHTERRESQ" Then
  596.         mnuRegister.Visible = False
  597.         frmAbout.lblRegto = "Registered to: " + RegTo
  598.         Exit Sub
  599.     Else
  600.         If OpenTimes > "0" Then
  601.             NewOpenTimes = OpenTimes - 1
  602.             frmGame.Caption = frmGame.Caption & " - !! You have " + NewOpenTimes + " uses left !!"
  603.             SetStringValue Path, UsedTimes, NewOpenTimes
  604.         ElseIf OpenTimes = "0" Then
  605.             MsgBox "You must register to continue to use this software" + Chr(10) + Chr(13) + "www.ciphersoftware.cjb.net", vbExclamation + vbOKOnly, "Information"
  606.             mnuGame.Enabled = False
  607.             frmGame.Caption = frmGame.Caption & " - !! Register Now !!"
  608.             Exit Sub
  609.         Else
  610.             CreateKey Path
  611.             SetStringValue Path, UsedTimes, Start
  612.             frmGame.Caption = frmGame.Caption & " - !! You have 10 uses left !!"
  613.         End If
  614.     End If
  615. End Sub
  616. Private Sub Form_Unload(Cancel As Integer)
  617.     End
  618. End Sub
  619. Private Sub G_Click()
  620.     Dim MyGuess As String
  621.     G.Visible = False
  622.     MyGuess = G
  623.     letters (MyGuess)
  624. End Sub
  625. Private Sub H_Click()
  626.     Dim MyGuess As String
  627.     H.Visible = False
  628.     MyGuess = H
  629.     letters (MyGuess)
  630. End Sub
  631. Private Sub I_Click()
  632.     Dim MyGuess As String
  633.     I.Visible = False
  634.     MyGuess = I
  635.     letters (MyGuess)
  636. End Sub
  637. Private Sub J_Click()
  638.     Dim MyGuess As String
  639.     J.Visible = False
  640.     MyGuess = J
  641.     letters (MyGuess)
  642. End Sub
  643. Private Sub K_Click()
  644.     Dim MyGuess As String
  645.     K.Visible = False
  646.     MyGuess = K
  647.     letters (MyGuess)
  648. End Sub
  649. Private Sub L_Click()
  650.     Dim MyGuess As String
  651.     L.Visible = False
  652.     MyGuess = L
  653.     letters (MyGuess)
  654. End Sub
  655. Private Sub labWord_Change()
  656.     If labWord = Word Then
  657.         Load frmWin
  658.         frmWin.Show
  659.     End If
  660. End Sub
  661. Private Sub M_Click()
  662.     Dim MyGuess As String
  663.     M.Visible = False
  664.     MyGuess = M
  665.     letters (MyGuess)
  666. End Sub
  667. Private Sub mnuAbout_Click()
  668.     frmAbout.Show
  669. End Sub
  670. Private Sub mnuAddWord_Click()
  671.     Load frmAddWord
  672.     frmAddWord.Show
  673. End Sub
  674. Private Sub mnuChooseWord_Click()
  675.     Load frmChooseWord
  676.     frmChooseWord.Show
  677.     Dim II As Integer
  678.     cWord = ""
  679.     Word = ""
  680.     template = ""
  681.     lblcword.Caption = ""
  682.     If lblcword.Caption = "" Then
  683.         MsgBox "Invalid Word", vbInformation + vbOKOnly, "Invalid Word"
  684.     Else
  685.     lblcword.Caption = ""
  686.     For II = 1 To Len(cWord)
  687.        template = template & "?"
  688.     Next II
  689.     labTotal.Caption = "0"
  690.     labWrong.Caption = "0"
  691.     wrong = 0
  692.     labWord = template
  693.     labOutput.Caption = ""
  694.     txtGuess.Visible = True
  695.     fraPlay.Visible = True
  696.     mnuResume.Enabled = False
  697.     mnuStop.Enabled = True
  698.     A.Visible = True
  699.     B.Visible = True
  700.     C.Visible = True
  701.     D.Visible = True
  702.     E.Visible = True
  703.     F.Visible = True
  704.     G.Visible = True
  705.     H.Visible = True
  706.     I.Visible = True
  707.     J.Visible = True
  708.     K.Visible = True
  709.     L.Visible = True
  710.     M.Visible = True
  711.     N.Visible = True
  712.     O.Visible = True
  713.     P.Visible = True
  714.     Q.Visible = True
  715.     R.Visible = True
  716.     S.Visible = True
  717.     T.Visible = True
  718.     U.Visible = True
  719.     V.Visible = True
  720.     W.Visible = True
  721.     X.Visible = True
  722.     Y.Visible = True
  723.     Z.Visible = True
  724.     Ground.Visible = False
  725.     pole.Visible = False
  726.     pole2.Visible = False
  727.     support.Visible = False
  728.     rope.Visible = False
  729.     head.Visible = False
  730.     body.Visible = False
  731.     larm.Visible = False
  732.     rarm.Visible = False
  733.     lleg.Visible = False
  734.     rleg.Visible = False
  735.     End If
  736. End Sub
  737. Private Sub mnuExit_Click()
  738.     End
  739. End Sub
  740. Private Sub mnuNew_Click()
  741.     Dim numWords As Integer
  742.     Dim Chooseword As Integer
  743.     Dim II As Single
  744.     Dim Random As Integer
  745.     template = ""
  746.     labWord.Caption = " "
  747.     Open App.Path & "\hangman.sys" For Input As #1
  748.     Do While Not EOF(1)
  749.         numWords = numWords + 1
  750.         Input #1, Word
  751.     Loop
  752.     Close #1
  753.     Chooseword = Int(numWords * labRandom.Caption)
  754.     Open App.Path & "\hangman.sys" For Input As #1
  755.     For II = 1 To Chooseword
  756.         Input #1, Word
  757.         Next
  758.     Close #1
  759.     For II = 1 To Len(Word)
  760.        template = template & "?"
  761.     Next II
  762.     labTotal.Caption = "0"
  763.     labWrong.Caption = "0"
  764.     wrong = 0
  765.     labWord = template
  766.     labOutput.Caption = ""
  767.     txtGuess.Visible = True
  768.     fraPlay.Visible = True
  769.     mnuResume.Enabled = False
  770.     mnuStop.Enabled = True
  771.     A.Visible = True
  772.     B.Visible = True
  773.     C.Visible = True
  774.     D.Visible = True
  775.     E.Visible = True
  776.     F.Visible = True
  777.     G.Visible = True
  778.     H.Visible = True
  779.     I.Visible = True
  780.     J.Visible = True
  781.     K.Visible = True
  782.     L.Visible = True
  783.     M.Visible = True
  784.     N.Visible = True
  785.     O.Visible = True
  786.     P.Visible = True
  787.     Q.Visible = True
  788.     R.Visible = True
  789.     S.Visible = True
  790.     T.Visible = True
  791.     U.Visible = True
  792.     V.Visible = True
  793.     W.Visible = True
  794.     X.Visible = True
  795.     Y.Visible = True
  796.     Z.Visible = True
  797.     Ground.Visible = False
  798.     pole.Visible = False
  799.     pole2.Visible = False
  800.     support.Visible = False
  801.     rope.Visible = False
  802.     head.Visible = False
  803.     body.Visible = False
  804.     larm.Visible = False
  805.     rarm.Visible = False
  806.     lleg.Visible = False
  807.     rleg.Visible = False
  808. End Sub
  809. Private Sub mnuRegister_Click()
  810.     Load frmReg
  811.     frmReg.Show
  812. End Sub
  813. Private Sub mnuResume_Click()
  814.     fraPlay.Visible = True
  815.     mnuResume.Enabled = False
  816.     mnuStop.Enabled = True
  817. End Sub
  818. Private Sub mnuStop_Click()
  819.     fraPlay.Visible = False
  820.     mnuResume.Enabled = True
  821.     mnuStop.Enabled = False
  822. End Sub
  823. Private Sub N_Click()
  824.     Dim MyGuess As String
  825.     N.Visible = False
  826.     MyGuess = N
  827.     letters (MyGuess)
  828. End Sub
  829. Private Sub O_Click()
  830.     Dim MyGuess As String
  831.     O.Visible = False
  832.     MyGuess = O
  833.     letters (MyGuess)
  834. End Sub
  835. Private Sub P_Click()
  836.     Dim MyGuess As String
  837.     P.Visible = False
  838.     MyGuess = P
  839.     letters (MyGuess)
  840. End Sub
  841. Private Sub Q_Click()
  842.     Dim MyGuess As String
  843.     Q.Visible = False
  844.     MyGuess = Q
  845.     letters (MyGuess)
  846. End Sub
  847. Private Sub R_Click()
  848.     Dim MyGuess As String
  849.     R.Visible = False
  850.     MyGuess = R
  851.     letters (MyGuess)
  852. End Sub
  853. Private Sub S_Click()
  854.     Dim MyGuess As String
  855.     S.Visible = False
  856.     MyGuess = S
  857.     letters (MyGuess)
  858. End Sub
  859. Private Sub T_Click()
  860.     Dim MyGuess As String
  861.     T.Visible = False
  862.     MyGuess = T
  863.     letters (MyGuess)
  864. End Sub
  865. Private Sub tmrChooseWord_Timer()
  866.     If lblcword.Caption = "" Then
  867.         MsgBox "Invalid Word", vbInformation + vbOKOnly, "Information"
  868.     Else
  869.     Word = lblcword.Caption
  870.     Dim II As Integer
  871.     cWord = lblcword.Caption
  872.     If lblcword.Caption = "" Then
  873.         MsgBox "Invalid Word", vbInformation + vbOKOnly, "Invalid Word"
  874.     Else
  875.     lblcword.Caption = ""
  876.     For II = 1 To Len(cWord)
  877.        template = template & "?"
  878.     Next II
  879.     labTotal.Caption = "0"
  880.     labWrong.Caption = "0"
  881.     wrong = 0
  882.     labWord = template
  883.     labOutput.Caption = ""
  884.     txtGuess.Visible = True
  885.     fraPlay.Visible = True
  886.     mnuResume.Enabled = False
  887.     mnuStop.Enabled = True
  888.     A.Visible = True
  889.     B.Visible = True
  890.     C.Visible = True
  891.     D.Visible = True
  892.     E.Visible = True
  893.     F.Visible = True
  894.     G.Visible = True
  895.     H.Visible = True
  896.     I.Visible = True
  897.     J.Visible = True
  898.     K.Visible = True
  899.     L.Visible = True
  900.     M.Visible = True
  901.     N.Visible = True
  902.     O.Visible = True
  903.     P.Visible = True
  904.     Q.Visible = True
  905.     R.Visible = True
  906.     S.Visible = True
  907.     T.Visible = True
  908.     U.Visible = True
  909.     V.Visible = True
  910.     W.Visible = True
  911.     X.Visible = True
  912.     Y.Visible = True
  913.     Z.Visible = True
  914.     Ground.Visible = False
  915.     pole.Visible = False
  916.     pole2.Visible = False
  917.     support.Visible = False
  918.     rope.Visible = False
  919.     head.Visible = False
  920.     body.Visible = False
  921.     larm.Visible = False
  922.     rarm.Visible = False
  923.     lleg.Visible = False
  924.     rleg.Visible = False
  925.     End If
  926.     End If
  927.     tmrChooseWord.Enabled = False
  928. End Sub
  929. Private Sub tmrRandom_Timer()
  930.     labRandom.Caption = Rnd
  931. End Sub
  932. Private Sub U_Click()
  933.     Dim MyGuess As String
  934.     U.Visible = False
  935.     MyGuess = U
  936.     letters (MyGuess)
  937. End Sub
  938. Private Sub V_Click()
  939.     Dim MyGuess As String
  940.     V.Visible = False
  941.     MyGuess = V
  942.     letters (MyGuess)
  943. End Sub
  944. Private Sub W_Click()
  945.     Dim MyGuess As String
  946.     W.Visible = False
  947.     MyGuess = W
  948.     letters (MyGuess)
  949. End Sub
  950. Private Sub X_Click()
  951.     Dim MyGuess As String
  952.     X.Visible = False
  953.     MyGuess = X
  954.     letters (MyGuess)
  955. End Sub
  956. Private Sub Y_Click()
  957.     Dim MyGuess As String
  958.     Y.Visible = False
  959.     MyGuess = Y
  960.     letters (MyGuess)
  961. End Sub
  962. Private Sub Z_Click()
  963.     Dim MyGuess As String
  964.     Z.Visible = False
  965.     MyGuess = Z
  966.     letters (MyGuess)
  967. End Sub
  968.