|
-
September 24th, 2010, 06:13 AM
#1
FOR LOOP dilemma
Hello everyone...im having problem with for loop---
Im making a simple hangaroo type game, everything works fine except for the validation, (where an x appears every wrong entry) heres my code:
----------------------------------------------------
For intX = 0 To UBound(strArr)
If lblhiddenchar(intX).Caption = cmdLetterPool(Index).Caption Then
lblhiddenchar(intX).Visible = True
'show the caption if the letter pressed is correct
Else
wrongGuess
'invokes a procedure to add an "X"
End If
Next intX
-------------------------------------------------------
Private Sub wrongGuess()
errorCount = errorCount + 1
Select Case errorCount
Case 1
imgX.Visible = True
Case 2
imgX2.Visible = True
Case 3
imgX3.Visible = True
Case 4
imgX4.Visible = True
Case 5
imgX5.Visible = True
MsgBox "Watch as this one validates.."
Unload Me
End Select
End Sub
-------------------------------
now, the problem is that when i click a wrong letter for the 1st time, it instantly unloads the form( case 5)..ive tried the exit for, but im still having problems..im new to visual basic, so any ideas?? any reply would be so helpful...thanks a lot
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|