Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398

    just to add to Colin's comments - if you are using this to resize a control, don't forget to to account for margins (if they are being used, default is 0 so you may not be) and border thickness which takes up space inside the stated size of a control

    other factor you may want to take into account is there are 15 twips to a pixel - the smallest unit by which a control can be positioned/sized on the screen (will be different for printers which uses DPI (dots per inch, typically 150 for normal resolution, so around 10 twips per dot). So 7200 is 480 pixels. Not sure whether with 7198 (479.87 pixels) would be rounded up or down but I would round whatever value you get returned to the next 15 - so 7201 would be rounded to 7215.

  2. #17
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    I allow 80 twips as a margin in my demo app but how much you allow is a matter of choice
    As it isn't possible to have part of a pixel, the figures are always rounded UP

    This is taken from my article: Accurately Move Forms & Controls (isladogs.co.uk)
    The position of objects in the Access window is determined in twips (one twentieth of imperial point size) where
    1440 twips = 1 inch or 567 twips = 1 cm

    The x-y coordinates of the top left of the application window are 0, 0

    However, the position of the mouse cursor is measured in pixels with reference to the overall screen:
    1 pixel (px) = 15 twips so 96px = 1440 twips = 1 inch

    Font size is measured in points (pt) where 1 point = 20 twips
    A 72 point font = 1 inch = 1440 twips = 96px ;
    Similarly 12pt = 16px = 240 twips = 1/6 inch, 3 points = 60 twips = 4 px etc

    Complications arise with font sizes that are NOT factors of 72. For example:
    a) 11 pt font = 220 twips high = 14.667 px . . . but as you cannot have a part pixel that actually requires 15 px
    b) 10 pt font = 200 twips high = 13.33px . . . so this takes up 14px which is a significant difference
    You will notice a similar effect when you try to set control sizes in the property sheet. Access often adjust these to ensure the value corresponds to a whole number of pixels

    On all the machines I've tested, the dots per inch (DPI) setting is 96 ....AT standard 100% scaling.
    If your scaling factor is 125% that becomes 1.25*96=120 & at 150% its 1.5*96=144 etc
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #18
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    When I ran the sample code, that was included in the downloaded mdb, I noticed that there was a blank after "Arial " falsely concluding that is was required for some odd reason. I ran another test on a 7 inch sample using "Times New Roman" and hit the "jackpot" at 10080 Twips.

    BTW, the application here is fitting a character string into potentially multiple lines during formatting of a report. The task at hand involves a bit more than simply changing the size properties of a text box, given the specific content of the string.

    Thanks everyone,
    Bill

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Consistent Character Length in Fields
    By Min Donner in forum Access
    Replies: 2
    Last Post: 05-10-2019, 09:29 AM
  2. dealing with zero length strings
    By markjkubicki in forum Programming
    Replies: 5
    Last Post: 10-08-2016, 07:29 PM
  3. Replies: 1
    Last Post: 09-16-2013, 04:35 PM
  4. Replies: 8
    Last Post: 02-22-2012, 11:58 AM
  5. Fixed character length of field
    By tylerg11 in forum Access
    Replies: 3
    Last Post: 09-29-2011, 11:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums