Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I code an image into a picture box

Status
Not open for further replies.

jono261970

Programmer
Jun 28, 2002
182
GB
Hello,

I can easily add a picture to the picture box using the GUI, but how do I populate the picture box using code.

I have tried something like picture1.picture =c:\myimage.bmp and always get an error.

Ideally I would like to store 10 pictures into an array and then call them as and when needed.

cheers,

jono
A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
 
I believe the correct syntax would be.
picture1.picture=loadpicture("c:\mypicture")
 
jono ..
Use an imagelist control to as a reposotory for the pictures
Its' use is well covered in MSDN Library. you can reference them by Tag or index.
 
Thanks guys. You have all been of great help.

cheers,

jono
A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top