Results 1 to 15 of 15

Thread: Looping to see if something = something(resolved)

Hybrid View

  1. #1
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Looping to see if something = something

    See post #6. Use the picture index as the tag.

  2. #2

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Looping to see if something = something

    I'm trying to use this, but it is not working here is my code
    VB Code:
    1. Private Sub lblCover_Click(Index As Integer)
    2.    
    3.     Dim i As Integer
    4.    
    5.     clickcount = clickcount + 1
    6.     lblCover(Index).Visible = False
    7.     For i = 0 To 15
    8.         If lblCover(i).Visible = False Then
    9.             If clickcount = 2 Then
    10.                 picSecond.Picture = imgPicture(i).Picture
    11.                 picSecond.Tag = i
    12.             Else
    13.                 picFirst.Picture = imgPicture(i).Picture
    14.                 picFirst.Tag = i
    15.             End If
    16.         End If
    17.     Next i
    18.     If clickcount = 2 Then
    19.         Call CheckMatch
    20.     End If
    21. End Sub
    22.  
    23. Public Sub CheckMatch()
    24.  
    25.     Dim i As Integer
    26.    
    27.     If picFirst.Tag = picSecond.Tag Then
    28.         tmrWin.Enabled = True
    29.         clickcount = 0
    30.     Else
    31.         tmrLose.Enabled = True
    32.         clickcount = 0
    33.     End If
    34.  
    35. End Sub

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Looping to see if something = something

    I think you need another array of default picture names. When you click picture6 and it has image 4 in it, you would want to save pointer(4) to the tag property. The method I posted won't work because you won't be clicking on the same picture twice, so they won't match. If both tags contained pointer(4), they would match.

    Post your project and I'll look at it.

  4. #4

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Looping to see if something = something

    Here you go
    Attached Files Attached Files

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Looping to see if something = something

    I'll look at it when I get back.

  6. #6

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Looping to see if something = something

    Take your time

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Looping to see if something = something

    I had to make a few changes, but I think you'll like it
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width