Jump to content

Hang Man Game

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
darkcast

darkcast

    Newbie

  • Members
  • Pip
  • 6 posts
Hi, i need some help with a school project i have !
im not asking for someone to do it for me im just asking if some could help me understant it a little better.
im supposed to do this
THANK YOU

Declare a form-level variable named strLetterGuessed as type String.
Add code to the btnGuessL_Click event procedure to set the value of strLetterGuessed to the value in txtLetter.

this is my code so far
Public Class frmMain



   

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

        Close()

    End Sub


    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click

        lblWord.Text = "????????????"

    End Sub


    Private Sub btnGuessL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuessL.Click


    End Sub


    Private Sub btnGuessW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuessW.Click


    End Sub


    Private Sub btnSolve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSolve.Click

        lblWord.Text = "BASSETT HOUND"

    End Sub


    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub

End Class



#2
thanasis2028

thanasis2028

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
First of all, you have to declare the form-level variable. To do so, add this code after Public Class frmMain
Dim strLetterGuessed as String
And then, you have to change the btnGuessL_Click code:
Private Sub btnGuessL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuessL.Click
txtLetter.text=strLetterGuessed
End Sub

My software company:Porosis Software
Games: Terrantula
Apps: Mathanasis, ColorGrabber (New!)