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
Printable View
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
set the .tag property to the image location, then compare that.
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.
Something like this maybe?
VB Code:
Dim CompPic As Picture CompPic = LoadPicture(FileName) If Picture1.Picture = CompPic Then '...
just keep track of the filename when you set it..... like in the tag property, or in some static/global variable.