Results 1 to 2 of 2

Thread: ScaleMode and TwipsPerPixel, their role in sizing problems due to Large/Small fonts

  1. #1

    Thread Starter
    Hyperactive Member davem's Avatar
    Join Date
    Dec 2000
    Location
    Gainesville, FL
    Posts
    265

    ScaleMode and TwipsPerPixel, their role in sizing problems due to Large/Small fonts

    Ok...

    TwipsPerPixel in small fonts (normal, windows default) is 15. So when we change that to large fonts and the TwipsPerPixel value changes to 12... this causes sizing problems on our form. For example... a 10 pixel image in small fonts is 150 twips wide. But in large fonts it is only 120 twips wide. This means that the image is actually displayed smaller in the large fonts mode.

    To overcome this I found if you change the ScaleMode property of the form housing all the controls to the right factor...
    VB Code:
    1. Form.ScaleMode = vbUser
    2. Form.ScaleWidth = (TwipsPerPixel / 15) * Form.Width
    3. Form.ScaleHeight = (TwipsPerPixel / 15) * Form.Height

    This would then make our own coordinate system that would account for the font scaling. So when we say Label1.Left = 15, this would put the label in the proper position regardless of what the TwipsperPixel value is.

    My question is: Do I have to re-position every control in code to make this work?

  2. #2

    Thread Starter
    Hyperactive Member davem's Avatar
    Join Date
    Dec 2000
    Location
    Gainesville, FL
    Posts
    265
    Anyone?!?

    More simply, I am asking:

    Is there an easy way to change the scale of everything on my fore when TwipsPerPixel goes from 15 to 12?

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