setting picture property

haisai54
haisai54 used Ask the Experts™
on
hi,

i've image control on my form.i want to set the picture property of image control and forms icon during runtime.

i did like this:

graphics1.picture="c:\windows\stop.bmp"
form1.icon="c:\windows\stop.ico"

i am getting error typemismatch.can anybody help me how to set the picture runtime.

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
graphics1.picture = LoadPicture("C:\windows\stop.bmp")
Commented:
same for icon

Author

Commented:
hi bobbit31,

i am developing the code in appforge application.so its not normal VB.so when i am giving as graphic1.picture="c:\windows\sample" ,its giving error as "can't open file"

anyidea...
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
you need to use LoadPicture()...

Author

Commented:
i used loadpicture but still its not working..its giving error "can't open file"

Commented:
Have you verified the picture is a valid bmp, not corrupted?  Can you open it in Paint?
Author of the Year 2009

Commented:
Moderator, my recommended disposition is:

    Accept bobbit31's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial