Results 1 to 4 of 4

Thread: *Resolved* shrinking text inside a fixed size label :(

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    90

    *Resolved* shrinking text inside a fixed size label :(

    Hi All,

    I'm wanting to do something a bit different and shrink the text within a fixed size label.

    I'm using the following code to shrink the text (using ARIAL 72 point initially), but it only works when I've printed something first.
    Otherwise it doesn't work at all.

    Even if something has been printed, it isn't exactly perfect.
    The problem is really bad when there are spaces in the text.

    Perhaps a way without using the printer??

    Can someone help.

    Regards

    Chris B

    --------------------------------------------------------------------------

    shrinktry = 100

    While Printer.TextWidth(TextData(Y).Caption) > TextData(Y).Width And shrinktry > 0
    Printer.Font.Size = Round(Printer.Font.Size) - 1
    shrinktry = shrinktry - 1
    Wend
    Last edited by cboffsite; Dec 3rd, 2002 at 05:04 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    90
    I worked it out,

    by passing all the label attributes to the form and using the form's textwidth attribute I can work it all out.

    Regards

    Chris B

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    for a start you can use a standard picturebox in place of the printer, next make sure that ALL font properties are the same (font name/style, size, bold, underline, etc.)

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    oh well, too slow!

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