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

Size window to image size

Status
Not open for further replies.

Giddygoat

Programmer
May 16, 2001
36
GB
If I load a picture in to a picture box which is in turn on a form, how can I resize the form to the size of the picture once the picture has loaded?

Cheers

John
 
Try this...
[tt]
Dim ScalemodeBak As Integer

ScalemodeBak = ScaleMode
ScaleMode = vbTwips

Picture1.left = 0
Picture1.top = 0
Width = Picture1.Width
Height = Picture1.Height

ScaleMode = ScalemodeBak
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top