How to Stretch Background Picture?

I use a PictureBox as a container for one 'panel' on an MDI form.  The graphic (jpg) that I want to use as the backround picture is shorter than the height of the panel.  Thus when I load the graphic it only shows a background for the top 3/4 of the picturebox and then stops.  Are there any options to set which will 'stretch' the graphic to fit the entire area of the picture box.

When I have preiously placed pictures in an image control on the form there was s 'stretch' property to accomodate this.  There is no corresponding property on a picturebox control.

Any suggestions?
LVL 1
mlcktmguyAsked:
Who is Participating?
 
PaulHewsConnect With a Mentor Commented:
Private Sub Picture1_Paint()
    Picture1.PaintPicture LoadPicture("C:\temp\1.jpg"), 0, 0, Picture1.Width, Picture1.Height
End Sub

If you want to store the picture in the picturebox at design time, you can load it into a second picture box, set the visible to false on the second and write the paint procedure like this:

Private Sub Picture1_Paint()
    Picture1.PaintPicture Picture2.Picture, 0, 0, Picture1.Width, Picture1.Height
End Sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.