-
Whats wrong with this code (Faze1 is a random number from 1-3, Face is a picturebox:
If Faze1 = 1 Then FACE = (App.Path & "\Antonio.bmp")
This continues up to 3 with a different .bmp picture each time, but the program never show the picture it highlights the & and comes up with the error 'Type Mismatch'
I don't have the MSDN help collection so I can't find the correct usage.
Thanks for any help.
-
you are trying to send a string value to Face, not a picture!
try
'#####
Face.loadpicture(Path)
'#####
instead.
MSDN has a website that you can look at. It is a mirror of the CD's
[Edited by wossname on 08-26-2000 at 11:23 AM]
-
-
but that doesn't work!
i just tried it
-
Try this:
[code]
dim path as string
dim faze1 as integer
path = App.path + "\Antonio.bmp"
if faze1 = 1 then
face.picture = path
else
end if
-
-
-
You need to use
Set FACE.Picture = LoadPicture(sPath)
-
Try this:
Code:
Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
It should work.
Hope this helps.
-
it now says, in an error window and you have the choice to debug or end:
object variable or with block variable not set
any ideas?
-
What part does it highlight? :confused:
-
Face.Picture = LoadPicture(Path)
that part
-
Try:
Code:
Set Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
Even though the first suggestion worked on my computer.
-
i'll give it a go.
if not do you mind checking over the full code related to this prob.? (its not much)
ok back in a sec..
-
i had the picture dimmed as a picture box and was making one other idiotic mistake.
i tried what you suggested 1st time and it worked.
thanks for your help.
you probably wont be asking me for any but thanks.