Results 1 to 6 of 6

Thread: [RESOLVED] picture box help

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    49

    Resolved [RESOLVED] picture box help

    I am trying to find a way to basically check that if all picture boxs are black then you have completed the game

    i am looking for somthing along the lines of

    VB Code:
    1. If PIC_ALLSET = 33554431 Then
    2. MsgBox ("congratulations you took : " & sec & " seconds")
    3. Else
    4. End If

    but this does not work for some reason

    Thank for help in advance

    Daniel o/

  2. #2
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    Re: picture box help

    VB Code:
    1. If Picture1.BackColor = vbBlack Then
    2.     MsgBox ("congratulations you took : " & sec & " seconds")
    3. End If
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  3. #3
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: picture box help

    IF there are multiple boxes, are they in an array?

    If so, you could just cycle through each one with a For loop and set a boolean variable that tells you if any of them are not black.

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    49

    Re: picture box help

    can u give a example of what you mean please didnt quite uderstand what u was getting at then timeshifter

    thnx

  5. #5
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    Smile Re: picture box help

    This may work ,
    If you have 10 Pictureboxes :

    VB Code:
    1. Dim i As Integer , x As Integer
    2. For i = 0 to 9
    3.     If Picture1(i).BackColor = vbBlack then x =x +1
    4. Next
    5. if x = 10 then MsgBox ("congratulations you took : " & sec & " seconds")
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    49

    Re: picture box help

    yeh that works cheers for the help o/

    [Resolved]

    Dan

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