Resizing image along with PictureBox

SSb

Member
Joined
Sep 28, 2005
Messages
14
Programming Experience
Beginner
Hi all,
I have a PictureBox with a picture in it which fills the box completely. I need to change the size of the PictureBox dynamically. The height of the PictureBox changes as I want it to using PictureBox.Height. But the picture in the box remains at its original size. Is it possible to have the picture also stretch/contract as the size of the PictureBox is changed ?

Thanks,
Saurabh
 
Here you go
VB.NET:
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage


You may need to call

VB.NET:
Me.Invalidate

in the picturebox.OnResize event​
 
Back
Top