Background Image

I have put an image on the background of my main form, what I want to know is if I can keep the image and all of the controls centered when the form is resized or maximized.
Can somebody please help?

Comments

  • : I have put an image on the background of my main form, what I want to know is if I can keep the image and all of the controls centered when the form is resized or maximized.
    : Can somebody please help?
    :

    I don't think you can if you set the background of the form with your picture, but... if you create a picturebox, put your pic in there, then create a FRAME and put your controls in there, then resizing is just a matter of centering just two controls!

    Hope this helps!
    Bradley q:)
  • : : I have put an image on the background of my main form, what I want to know is if I can keep the image and all of the controls centered when the form is resized or maximized.
    : : Can somebody please help?
    : :
    :
    : I don't think you can if you set the background of the form with your picture, but... if you create a picturebox, put your pic in there, then create a FRAME and put your controls in there, then resizing is just a matter of centering just two controls!
    :
    : Hope this helps!
    : Bradley q:)
    :

    If you feel like not wasting memory, there's a slightly more complicated method: load the picture into a StdPicture object, then PaintPicture it into the Form.
  • : : : I have put an image on the background of my main form, what I want to know is if I can keep the image and all of the controls centered when the form is resized or maximized.
    : : : Can somebody please help?
    : : :
    : :
    : : I don't think you can if you set the background of the form with your picture, but... if you create a picturebox, put your pic in there, then create a FRAME and put your controls in there, then resizing is just a matter of centering just two controls!
    : :
    : : Hope this helps!
    : : Bradley q:)
    : :
    :
    : If you feel like not wasting memory, there's a slightly more complicated method: load the picture into a StdPicture object, then PaintPicture it into the Form.
    :

    Or waste slightly more than stdPicture (or less?) but nowhere near as much as a picbox: Load the picture into an image control and set stretch to True.

    For your controls (including the above image control), use the Form_Resize event and calculate the new positions of your controls and move them accordingly. Keep in mind that you will need error trapping just in case any values get too small...
  • : : : : I have put an image on the background of my main form, what I want to know is if I can keep the image and all of the controls centered when the form is resized or maximized.
    : : : : Can somebody please help?
    : : : :
    : : :
    : : : I don't think you can if you set the background of the form with your picture, but... if you create a picturebox, put your pic in there, then create a FRAME and put your controls in there, then resizing is just a matter of centering just two controls!
    : : :
    : : : Hope this helps!
    : : : Bradley q:)
    : : :
    : :
    : : If you feel like not wasting memory, there's a slightly more complicated method: load the picture into a StdPicture object, then PaintPicture it into the Form.
    : :
    :
    : Or waste slightly more than stdPicture (or less?) but nowhere near as much as a picbox: Load the picture into an image control and set stretch to True.
    :
    : For your controls (including the above image control), use the Form_Resize event and calculate the new positions of your controls and move them accordingly. Keep in mind that you will need error trapping just in case any values get too small...
    :

    Slightly more: an Image control has a Picture property, which evaluates to a StdPicture object, so I can't see *how* an Image control with one StdPicture inside it could be lighter than a StdPicture alone *LOL*
  • : Slightly more: an Image control has a Picture property, which evaluates to a StdPicture object, so I can't see *how* an Image control with one StdPicture inside it could be lighter than a StdPicture alone *LOL*
    :

    I agree, but I don't know for sure. Anyone get a copy of VB's source code?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories