Author Topic: Re-enable objects  (Read 1894 times)

0 Members and 1 Guest are viewing this topic.

M-dub

  • Guest
Re-enable objects
« 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

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16784
  • Superior Stupidity at its best
Re-enable objects
« Reply #1 on: August 31, 2004, 05:50:07 PM »
object.enabled = true
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

M-dub

  • Guest
Re-enable objects
« Reply #2 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

M-dub

  • Guest
Re-enable objects
« Reply #3 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

M-dub

  • Guest
Re-enable objects
« Reply #4 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.

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