Results 1 to 8 of 8

Thread: yet another problem :(

  1. #1

    Thread Starter
    Member shulc's Avatar
    Join Date
    Mar 2002
    Location
    cluster 15326
    Posts
    41

    Angry yet another problem :(

    ok - i have two images on the form if i click on ont of them it should dissapear and somewhere on a label to be displayed as 1 and if i click on the next image also to dissapear and the label to show 2 HELP..
    REALLY BAD & METAL MAD

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    ?

    could u elaborate a bit ?
    -= a peet post =-

  3. #3
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Assuming your images are called Picture1 and Picture2:

    VB Code:
    1. Private Sub Picture1_Click()
    2. Picture1.Visible = False
    3. Label.Caption = "1"
    4. 'make the other picture visible again (Don't know if neccesary)
    5. Picture2.Visible = True
    6. End Sub
    7.  
    8. Private Sub Picture2_Click()
    9. Picture2.Visible = False
    10. Label.Caption = "2"
    11. 'make the other picture visible again (Don't know if neccesary)
    12. Picture1.Visible = True
    13. End Sub

  4. #4

    Thread Starter
    Member shulc's Avatar
    Join Date
    Mar 2002
    Location
    cluster 15326
    Posts
    41
    but what if i have 50 (for example) pictures? The code would be huge. I need something like if another piture is hidden then label +1 ?
    REALLY BAD & METAL MAD

  5. #5
    khalik
    Guest
    use control array and use the index value to display in label

  6. #6
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Then you should call all the picture different. Like this:
    Picture(0), Picture(1), Picture(x).

  7. #7
    khalik
    Guest
    Private Sub Picture1_Click(Index As Integer)
    Picture1(index).Visible = False
    Label.Caption = index
    'make the other picture visible again (Don't know if neccesary)

    End Sub

    if u want to make the rest picture visible u can loop....

  8. #8
    khalik
    Guest
    Private Sub Picture1_Click(Index As Integer)
    Picture1(index).Visible = False
    Label.Caption = index
    'make the other picture visible again (Don't know if neccesary)

    End Sub

    if u want to make the rest picture visible u can loop....
    and set the visible =true

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