Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculating width of a text control (2003)

    I've been helped by the Lounge before with positioning controls, setting control height etc. (1440 twips to the inch), but is there a way to calculate the width of a control which contains variable font text, in this case Arial?
    I could use a standard one tenth of an inch per character, which I believe is what is allocated to a fixed font like Courier, but I'd prefer to calculate a proper width if possible.
    Thanks
    Silverback
    Silverback

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculating width of a text control (2003)

    You need some Windows API code for this - see HOW TO: Limit the Number of Characters to the Size of the Text Box in Access 2002 for ideas (applies to other versions of Access too).

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculating width of a text control (2003)

    Oh wow. Thanks for pointing me towards this but it's too technical for me and the report in question.
    I'm just going to remove the control's border, so it will not be possible to see how wide it is!
    As always, many thanks
    Silverback
    Silverback

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •