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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resizing a form's picture

Status
Not open for further replies.

sfarfasrew

Programmer
Dec 3, 2005
3
US
I have a form with a picture on it (not a picture box, a picture as one of the properties of the form). How can I have the picture stretch itself when the size of the form changes?
 
There are probably several ways to do this.

I suggest that you put an image control on the form. Set the Top and Left to 0 and the stretch property to TRUE.

Include a resize event so that the image control resizes with the form.

You have to be careful because a form has a height and width property. Don't use these because they represent the outside border height and width (including the title bar and the border of the form). Insead, you should use ScaleHeight and ScaleWidth.

Ex.
Image1.Width = Me.ScaleWidth
Image1.Height = Me.ScaleHeight



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top