Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Change picture box size to fit new form


Clueless
 Share

Recommended Posts

Simple, you have to create a code upon loading the form..where it reads the change in size. Once the change in size is read in accordance you'd make a code where If a = this size then b = this size. It wouldn't need to be anything complex just some (if and then) codes as well as some possible rendering methods.
Link to comment
Share on other sites

I got the picture box size to change

```
Private Sub MainPic_Change()
If Form3.Height > MainPic.Height Then
MainPic.Height = Form3.Height
End If
If Form3.Width > MainPic.Width Then
Form3.Width = MainPic.Width
End If
End Sub

```
but now this doesn't have it's effect after the picturebox has changed it's size (it's supposed to scale picture to fit picture box but only scales to fit old picture box size).

```
Private Sub MainPic_Paint()
Dim Pic As Picture
MainPic.AutoRedraw = True 'Here or in Properties Window
Set Pic = LoadPicture(App.Path & "\Src\My Pictures\9.bmp")
MainPic.PaintPicture Pic, 0, 0, MainPic.ScaleWidth, MainPic.ScaleHeight
Set MainPic.Picture = MainPic.Image

End Sub

```
PS how do I change where this thread is to questions and answers?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...