Results 1 to 3 of 3

Thread: [RESOLVED] Set ScaleHeight of PictureBox

  1. #1

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Resolved [RESOLVED] Set ScaleHeight of PictureBox

    Howdy all,

    Just wondering if theres a simple equation needed to set the scaleheight of a Picturebox when its ScaleMode is set to pixels, using the Height property.

    Something like..
    VB Code:
    1. PictureBox.Height = 38 * Screen.TwipsPerPixelY
    I'm hoping to set the scaleheight to a certain number, but doing that normally does nothing but change the ScaleMode to User, thinking I'm making my own scale.

    Any help is greatly appreciated.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Set ScaleHeight of PictureBox

    The Height property depends on the ScaleMode of the Form it resides on and also what kind of border the PictureBox has. The ScaleHeight doesn't include the border. If you use the normal 3D-look the border is 2 pixels in height but you have the border in both the upper and lower sides meaning that the height is ScaleHeight + 4 pixels. You might need to recalculate that into Twips or whatever scalemode you have for the Form.

  3. #3

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Set ScaleHeight of PictureBox

    Oh god.

    I'd totally forgotten that it depended on the parent, in this case the form.

    Resolved making the Form's scalemode Pixels aswell.

    Thanks Joacim.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

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