• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Type mismatch loading image from file

Whenever I run the following command:

Image1.Picture = App.Path & "\" & ListView1.SelectedItem.ListSubItems(3).Text

I get a type mismatch error on the "&" symbol.

Can someone help me figure out how to load an Image.picture with a file on my hard drive?
0
perkster
Asked:
perkster
1 Solution
 
aikimarkCommented:
try
Image1.Picture = LOADPICTURE(App.Path & "\" & ListView1.SelectedItem.ListSubItems(3).Text)
0
 
rspahitzCommented:
Yup...points to aikimark

The picture property is a picture object, not a string...the file path is a string, so you get a type mismatch.

To get a picture object, you need to "convert" the string, which is what LoadPicture does.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now