Results 1 to 5 of 5

Thread: Resizing a form to match a background

  1. #1
    Guest

    Question

    Ok, I've the background picture of a fom is 320*240 pixels exactly. I want the form's edges to fit around this perfectly...which they do on my machine... but as soon as I run it on a machine with a different screen resolution the form is now the wrong size for the picture.

    How's the best way to resize the form to fit better? I though it would be something like:

    scalewidth = twipsperpixelx * 320
    scaleheight = twipsperpixely * 240

    but it doesn't seem to work properly. Any bright ideas?

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Smile

    Hi,

    I'm not saying that this will work but just give it a go anyway. Set the form's ScaleMode to '3 - Pixel' and then set the form's width to 320 or maybe just a little more if you take into account the form's border. Then simply do the same with the form's height but only this time set it to 240.

    I hope it helps!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

  3. #3
    Guest
    No tried that already, but it didn't work. Thanks for tryin anyway.

    Any other ideas?

  4. #4
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Wink

    Hi again,

    I have just one more idea. You could try placing your background image into an imagebox. Drag the top side of the imagebox up to the top of the form and drag the left side of the imagebox to the far left of the form. Now in the form load event enter this command:

    Form1.Width = Image1.Width + 10 'may have to add a little extra if you take into account the border

    Now do the same with the Height.

    I hope you have more luck with this one!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

  5. #5
    Guest

    Thumbs up I can see it all now!

    Oh, yeah!! didn't think of that!! Silly me. Of course that'll work...but that's too simple!

    Ta.

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