Re: How many chars can be displayed in a label?
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Thu, 27 Apr 2006 08:14:07 -0500
True.Kilted.Scot@xxxxxxxxx wrote:
I have a window in my database which contains 5 labels. These labels
are used for displaying altering text, with a font of Tahoma and a Font
Size of 10.77
For example...the first label might display "Starting........."
initially, and then this may change to "Running...". Once the
"Running..." process has completed, the text may change to "Stage One
Done...", with the second label changing to "Starting........." and so
on.
My question is this:
If each label has the same dimensions, namely:
Width = 7cm
Height = 0.5cm
and any label can display BOLD text as well as NORMAL, is there any way
I can calculate the number of characters that will be displayed within
the 7cm width of the label. For example, the text "The quick brown fox
jumped over the lazy dog" is too big for the box, just cutting of a
portion of the "g". If I change the text to BOLD, it now cuts off
everything after the "z" of lazy.
So, using the font name, the font size and the width of the label, can
I caluclate a rough approximation of the number of characters that can
be displayed in it?
There's may be a combination of API calls that could be used
to figure the number of characters, but I have no idea what
they might be. I have never been concerned with the number
of characters because I have always wanted to determine the
width of the entire string.
If you can live with determining if the string will fit or
not or even how wide the text box needs to be to contain the
entire string, then download the TextHeightWidth db at
www.lebans.com
--
Marsh
MVP [MS Access]
.
- References:
- How many chars can be displayed in a label?
- From: True.Kilted.Scot@xxxxxxxxx
- How many chars can be displayed in a label?
- Prev by Date: Re: loop form
- Next by Date: Re: Unbound Text Box in Subform
- Previous by thread: Re: How many chars can be displayed in a label?
- Next by thread: Re: Changing color on continuous form
- Index(es):
Relevant Pages
|