|
-
December 4th, 2003, 02:07 PM
#1
Testing Image Path
I've searched through these forums for about a week and I have not been able to find anything about this.
I've got a Image that loads with the path App.Path & "open.bmp"
The picture loads find into the Image control. Now I want to test the path of the Image when I click on it. If the path is open.bmp, I want it to change to closed.bmp. When I run the code below, it errs at the If statement, stating a Type Mismatch. It is probably something simple that I am missing.
If imgLight(Index).Picture = App.Path & "open.bmp" Then
imgLight(Index).Picture = LoadPicture("closed.bmp")
End if
Any help is appreciated, its been bugging me for a while now.
Peace from the Pup
"Don't get burned, debug to death"
-
December 4th, 2003, 02:51 PM
#2
If you only have one Image Control, you don't need to reference it using an index. You only need to index the image list contained therein:
Try something like
imgLight.ListImages(Index).Picture =
Also, your if statement is wondering what you want. Try something like:
If imgLight.ListImages(Index).Tag = "open.bmp" Then
That is assuming you assigned it a name of open.bmp when you loaded it to begin with.
-
December 10th, 2003, 03:07 PM
#3
I'm not sure what an Image Control is. Do I have to load the bitmaps into the list before the program runs?
Also, I inserted your revised If statement and it didn't run. It gives me a compile error. "Method or data member not found"
If you would like, I can upload the vb files if you want to look at them.
Thanks for the help.
Peace from the Pup
"Don't get burned, debug to death"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|