Results 1 to 5 of 5

Thread: Simple question on Image

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Philippines
    Posts
    85

    Simple question on Image

    Hi to all!

    How can i check what picture is loaded in an image control?

    I've tried this code, but doesn't work:

    If image1.picture = "C:\computer.ico"
    msgbox " image1 has an icon of a computer"
    else
    msgbox " no computer icon has been found"
    endif

  2. #2
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    set the .tag property to the image location, then compare that.
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  3. #3
    Junior Member
    Join Date
    May 2003
    Posts
    27
    You could set each path/picture you load to a variable first, such as MyPicture, then use Dir(MyPicture) when you want to know which one is loaded.

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Something like this maybe?

    VB Code:
    1. Dim CompPic As Picture
    2.  
    3. CompPic = LoadPicture(FileName)
    4.  
    5. If Picture1.Picture = CompPic Then '...


    Has someone helped you? Then you can Rate their helpful post.

  5. #5
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    just keep track of the filename when you set it..... like in the tag property, or in some static/global variable.

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