Code Red > VB(A)

Re-enable objects

(1/1)

M-dub:
As I stated in a previous post, I'm an extreme newbie to VB and I'm having a hard time with this little application I'm writing.  I can't figure out how to re-enable objects I've disabled.  Have a look at the code and tell me if you a) Don't know what I'm talking about or b) know exactly what I'm talking about and that you can help me out.


--- Code: ---    Dim Sel As Integer
    Dim i As Integer
   
Private Sub imgMemory_Click(Index As Integer)
    tmrShow.Enabled = True
    imgMemory(Index).Visible = False
    Sel = ((Sel) + 1)
If Sel = 2 Then
    For i = 0 To 15
        imgMemory(i).Enabled = False
    Next i
End If
End Sub

Private Sub tmrShow_Timer()
    For i = 0 To 15
        imgMemory(i).Visible = True
    Next i
    tmrShow.Enabled = False
End Sub
--- End code ---


Thanks a LOT!
Mike

Keith™:
object.enabled = true

M-dub:
Where?  I've tried it in a bunch of places and it doesn't work (for me...)
Does it have something to do with SEL?  When it runs through the code, would SEL be set back to zero or does it stay at 2?

Thanks Keith

M-dub:
Found it!

--- Code: ---
    Dim Sel As Integer
    Dim i As Integer

Private Sub imgMemory_Click(Index As Integer)
    tmrShow.Enabled = True
    imgMemory(Index).Visible = False
    Sel = ((Sel) + 1)
If Sel = 2 Then
    For i = 0 To 15
        imgMemory(i).Enabled = False
    Next i
End If

End Sub

Private Sub tmrShow_Timer()
    For i = 0 To 15
        imgMemory(i).Visible = True
        imgMemory(i).Enabled = True
    Next i
    Sel = 0
    tmrShow.Enabled = False
End Sub

--- End code ---

M-dub:
Ok, you'll laugh when you see this, but I'm having a really hard time with this...as 'simple' as the program is.  I've placed my application in the lily pond HERE.

This is a 'Memory' game and I'm trying to get it so that when a match is made, the image hiding the pictures remains invisible.  I either get all of them, or none of them.  Anyone willing to help me on this?

Thanks,
Mike

Navigation

[0] Message Index

Go to full version