Results 1 to 7 of 7

Thread: [2008][RESOLVED] Remove text longer then ... px

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    178

    Resolved [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:
    1. If sender = "frmFout" Then
    2.      If tekst.Length > 31 Then tekst = tekst.Remove(31, tekst.Length - 31) & "..."
    3. ElseIf sender = "frmOverhoor" Then
    4.      If tekst.Length > 18 Then tekst = tekst.Remove(18, tekst.Length - 18) & "..."
    5. ElseIf sender = "Print" Then
    6.      If tekst.Length > 57 Then tekst = tekst.Remove(57, tekst.Length - 57) & "..."
    7. 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
  •  



Click Here to Expand Forum to Full Width