|
-
Aug 26th, 2000, 09:56 AM
#1
Thread Starter
Member
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.
-
Aug 26th, 2000, 10:21 AM
#2
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]
-
Aug 26th, 2000, 12:02 PM
#3
Thread Starter
Member
-
Aug 26th, 2000, 02:26 PM
#4
Thread Starter
Member
but that doesn't work!
i just tried it
-
Aug 26th, 2000, 02:38 PM
#5
Hyperactive Member
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
-
Aug 26th, 2000, 03:33 PM
#6
Thread Starter
Member
-
Aug 26th, 2000, 05:24 PM
#7
Thread Starter
Member
-
Aug 26th, 2000, 05:32 PM
#8
Hyperactive Member
You need to use
Set FACE.Picture = LoadPicture(sPath)
-
Aug 26th, 2000, 05:33 PM
#9
Try this:
Code:
Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
It should work.
Hope this helps.
-
Aug 26th, 2000, 05:37 PM
#10
Thread Starter
Member
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?
-
Aug 26th, 2000, 05:40 PM
#11
What part does it highlight?
-
Aug 26th, 2000, 05:43 PM
#12
Thread Starter
Member
Face.Picture = LoadPicture(Path)
that part
-
Aug 26th, 2000, 05:48 PM
#13
Try:
Code:
Set Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
Even though the first suggestion worked on my computer.
-
Aug 26th, 2000, 05:52 PM
#14
Thread Starter
Member
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..
-
Aug 26th, 2000, 05:58 PM
#15
Thread Starter
Member
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.
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
|