Image and form resize

  • 11 years ago


    I want the picture1 to resize the sametime as the form. how would i do that?

    I can set the picture1.autosize to true under form_load() but i can't get the form1 to resize the sametime as the picture1.




  • 11 years ago

    Hi Wildturkey,

    I had a quick go and came up with this, I dont know if its exactly what you want but might give you some ideas!!  I prefer to use the ImageBox control instead of the PictureBox control because of its stretch property.  If you do the image resizing in the Form_Resize event they should appear to go at the same time:

    Private Sub Form_Load()
    'Alter the size of the form, in this case just maximise it
    Form1.WindowState = vbMaximized
    End Sub

    Private Sub Form_Resize()
    'As soon as the form is resized the image will follow
    Image1.Height = Form1.Height
    Image1.Width = Form1.Width
    Image1.Stretch = True
    Image1.Left = Form1.Left
    Image1.Top = Form1.Top
    End Sub

    Sorry if I've got the wrong end of the stick!!

  • 11 years ago
    I give that a try thanks

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”