Hey guys first time learning VB6 and i have to do a Hangman project for my Gr 10 class But i need some help. I am have trouble figuring out how i make the dashes come out in my label box when someone inputs a word.
Like say someone inputs the word Good. how would i make 4 dashes(__) come depending on the number of Letters that are in the word.
Here is my code, Thx in advance for your help.
Option Explicit
Dim strWordArray() As String
Dim intMasterArray() As Integer
Dim StrTitle As String
Dim LngIndex As Long
Dim intSize As Integer
Private Sub CmdDisplay_Click()
'( when you click this the dashes come up, idk how to do that but this is the button that is supposed to do it)
End If
End Sub
Private Sub Form_Load()
StrTitle = InputBox("Input Letter", " Letter")
intSize = Len(StrTitle)
ReDim strWordArray(1 To intSize)
ReDim intMasterArray(1 To intSize)
For LngIndex = 1 To intSize
strWordArray(LngIndex) = Mid(StrTitle, LngIndex, 1)
If strWordArray(LngIndex) = "_" Then
intMasterArray(LngIndex) = strWordArray(LngIndex)
ElseIf strWordArray(LngIndex) = "." Then
intMasterArray(LngIndex) = strWordArray(LngIndex)
ElseIf strWordArray(LngIndex) = "?" Then
intMasterArray(LngIndex) = strWordArray(LngIndex)
ElseIf strWordArray(LngIndex) = "!" Then
intMasterArray(LngIndex) = strWordArray(LngIndex)
End If
Next LngIndex
End Sub