Results 1 to 2 of 2

Thread: stupid question

  1. #1


    this is a stupid question but ill ask anyway. how do i make the form "wrap" around my picture box when i resize it during runtime?

    for example: if i press a button that will randomly change the size of the picture box, and the form will resize also to be the same size as the picture box.

    i have tried
    form1.width = picture1.width
    or even
    form1.width = picture1.scalewidth
    or anything similar to that but it makes it a little smaller then the picturebox so the picture gets "clipped".

    so again how would i do this? also i dont want it to be exactly the same size, i want to be just a little bigger so it leaves a border around the picturebox.

    thanx ahead of time

  2. #2
    Addicted Member
    Join Date
    May 1999
    Californ-I- A


    Try this ... might work. Where BorderSize is however big you want that border.

    Private Sub Picture1_Resize()
    Dim BorderSize as Integer
    BorderSize = 50

    Form1.ScaleWidth = Picture1.ScaleWidth + (2 * BorderSize)
    Form1.ScaleHeight = Picture1.ScaleHeight + (2 * BorderSize)
    Picture1.Move BorderSize, BorderSize

    End Sub

    Micah Carrick
    Ordinary joe, only not named joe.
    ICQ: 53480225

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width