Results 1 to 4 of 4

Thread: Size Form from Picture box X & Y

  1. #1

    Thread Starter
    Lively Member THCfog's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    86

    Size Form from Picture box X & Y

    Picture1.Left=0
    Picture1.Top=0
    Me.Height=Picture1.Height
    Me.Width=Picture1.Width
    ~
    Scale mode for both are twip. Both have auto redraw on.
    ~
    Has always given me problems. I usually fixed this by adding more to either height and width. Recently, I noticed that changing the Title bar settings ( in windows display options ) changes this dramatically.

    Every code I have seeninvolving form height and width seemed to point towards the interior of the form, and not include the title bar.

    I have uploaded a picture for an example. ( A. is to show the size of the picture i want the form to match )

    Anyone have a idea how to make this code work correctly nomatter what the users titlebar settings are? Possibly a way to grab the height of the title bar.


    Thanks ahead of time...
    Attached Images Attached Images  

  2. #2

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Try not dynamically resizing at all. Remove this:

    Me.Height=Picture1.Height
    Me.Width=Picture1.Width
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    There are two API's that I think you can use to get the title bar's height, among other things.

    GetSystemMetrics and SystemParametersInfo

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