PDA

Click to See Complete Forum and Search --> : Changing the image in a picturebox with Code


Aerials
Aug 4th, 2002, 01:05 PM
I thought I'd posted this somewhere...

Oh well
This might sound like a stupid question but im a newbie so bear with me
How do I make a button change the image in a picture box?
How do i set the image property from code?

MrPolite
Aug 4th, 2002, 06:40 PM
this works for me:

PictureBox1.Image = New Drawing.Bitmap("C:\somePic.bmp")

Matt02
Aug 5th, 2002, 03:27 AM
Or you could use this method to support more file types

PictureBox1.Image = Image.FromFile("C:\logo.gif")

MrPolite
Aug 5th, 2002, 03:31 AM
more file types?! eeeh, which supports what?

Cander
Aug 5th, 2002, 09:01 AM
Drawing.Bitmap also support Gif, Jpeg, tiff, png, ico

Matt02
Aug 5th, 2002, 08:31 PM
Opps, sorry about that.
:D