|
-
May 16th, 2008, 02:16 PM
#1
Thread Starter
Addicted Member
[2008][RESOLVED] Remove text longer then ... px
Hello,
I'm developing a word-teaching program. When choosen, it shows wich chapters you're busy with. But if they get too long for the form, I want to change the last 3 characters shown on the form to be "...".
Then it would be "Chapter 1, 2, 3, ..." instead of "Chapter 1, 2, 3, 4, 5, 6" from wich the half isn't visible anymore.
I've tried to calculate on the textlength, but since not every character equals in width, this doesn't work properly. My calculations take place in a function wich multiple forms use.
A piece of my original function Code:
If sender = "frmFout" Then
If tekst.Length > 31 Then tekst = tekst.Remove(31, tekst.Length - 31) & "..."
ElseIf sender = "frmOverhoor" Then
If tekst.Length > 18 Then tekst = tekst.Remove(18, tekst.Length - 18) & "..."
ElseIf sender = "Print" Then
If tekst.Length > 57 Then tekst = tekst.Remove(57, tekst.Length - 57) & "..."
End If
How can I do this on a different way and make it work properly?
With kind regards,
Thomas
Last edited by Mindstorms; May 17th, 2008 at 06:34 AM.
Reason: Resolved
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
|