TheSwamp

Code Red => VB(A) => Topic started by: M-dub on August 31, 2004, 05:28:38 PM

Title: Re-enable objects
Post by: M-dub on August 31, 2004, 05:28:38 PM
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: [Select]
   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


Thanks a LOT!
Mike
Title: Re-enable objects
Post by: Keith™ on August 31, 2004, 05:50:07 PM
object.enabled = true
Title: Re-enable objects
Post by: M-dub on August 31, 2004, 06:01:26 PM
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
Title: Re-enable objects
Post by: M-dub on August 31, 2004, 06:06:09 PM
Found it!
Code: [Select]

    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
Title: Re-enable objects
Post by: M-dub on September 01, 2004, 12:46:42 PM
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 (http://theswamp.org/lilly_pond/mike/Memory.zip?nossi=1).

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