Click to See Complete Forum and Search --> : Image Control


esierp
January 19th, 2000, 11:04 PM
I have an image control on my form. I am trying to load a picture into it at run-time. I am using the following piece of code for this:

Set MyImageControl.Picture = LoadPicture("D:\MyPic.jpg")

When I run the program, I get the following error:
Compile Error: Wrong number of arguments or invalid property assignment
And when I return to the code window, LoadPicture is highlighted.

From everything that I have seen about the Image control, this should work. If I set the picture at design time, it works fine. Am I possible forgetting to include some Reference that I need? I have also tried using a PictureBox control and receive the same error. If anyone has any ideas, I would appreciate it.

Thanks in advance

juanda
January 19th, 2000, 11:40 PM
Hi, maybe you can try omitting the Set statement; just type:
MyImageControl.Picture = LoadPicture("D:\MyPic.jpg")

I am not 100% certain in your case, but I have been using LoadPicture with existing image controls in a form and it works.

I hope this helps. :-)

esierp
January 19th, 2000, 11:43 PM
Thanks for the reply, but I receive the same error even after omitting Set.