|
-
Dec 28th, 2023, 11:16 PM
#1
Thread Starter
New Member
VB6: label caption displays only to last visible space - need to compute text width
Our program displays text in a label's caption. The label has no wordwrap, is one line, fixed width.
I need to find out the width of the displayed text.
When the caption is longer than what fits the label, one of two things happen:
If there are no spaces in the text, the full width of the label contains contains letters. (In this case, the width of the displayed text is the label width)
If there are spaces, VB displays text up to the last visible space, and drops the rest.
Two Qs:
- Is it possible to make VB display as much of the caption as possible?
- [If not]: How can we determine the width of displayed text? When we write the text into an auto-adjust label, the label size is determined by the full text, not the text displayed up to the last space.
We could implement an iterative "keep cutting text after space" until the width is less than the label width, but this is tedious, inelegant, and possibly prone to errors.
Tnx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|