Results 1 to 3 of 3

Thread: forms background picture.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    does anyone have a code that will resize the forms background picture to the size of the form automatically no matter what size the form is?

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Posts
    219

    Post

    try this you need a picture box

    Picturebox autosize = true
    picturebox visible = false

    form1.picture = loadpicture(picture1.picture)
    form1.width = picture1.width
    form1.height = picture1.height


  3. #3
    Junior Member
    Join Date
    Jan 2000
    Location
    Bryan, Texas
    Posts
    27

    Post

    You could work around this problem. Instead of trying to resize the picture property of the form you could simply add an image as the first control on your form and resize it as the form is resized....Here's how I'd do it....
    1. Start a new project.
    2. Add an Image to the form.
    3. Set the TOP and LEFT properties to "0". Also change the stretch property to "True".
    4.Finally add this code to the Form_Resize()

    Private Sub Form_Resize()
    Image1.Width = Form1.Width
    Image1.Height = Form1.Height
    End Sub

    That should do it... Also you could change the background property of the form to a color close to the color of the background image (this reduces some static during resize). I know this is a cheap way to do it (and there are probably better ways), but it's only my second week of VB.

    Mitchell Hayenga
    [email protected]

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