[RESOLVED] Displaying picture in Image / picture control
Dear All,
I have placed an image control on my form. A bitmap picture(picture name is shapes) is placed at my C drive. There is also a command button on the form.
I want that when I click the button, the picture should be displayed in the image control.
When I use the following code in the click event of command button it gives me type mismatch error.
Me.Image1.Picture = "C:\shapes"
If I try to do so using Picture control, same error comes.
Plz help and guide.
Regards,
Re: Displaying picture in Image / picture control
The type mismatch is because "C:\shapes" is a String and vb can't make an image of it. You have to load the picture from the file like this
VB Code:
Me.Image1.Picture = LoadPicture("C:\shapes.bmp")
Also make sure you include the extension of the image like bmp or gif or jpg ...
Re: Displaying picture in Image / picture control
use the LoadPicture function.
Like,
VB Code:
Picture1.Picture = LoadPicture("C:\shapes\SomePicture.jpg")
Re: Displaying picture in Image / picture control
Thank you so much to both of you for your help.