Results 1 to 8 of 8

Thread: Text height

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Text height

    Hey,

    I have a form with a grid in it. The grid's dock property is set to fill so that it resizes along with the form. I have rows with captions saying hours of the day. I want to change the font size of the rows' captions as soon as the text is a lot smaller than the row height. Is there a way to figure out the height of a text in pixels? I can then compare it to the row's height to see.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Text height

    Can't you just get the font size of the grid?? And compare it to the row height?

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: Text height

    I just found the height property of a font object. Thanks.
    Don't anthropomorphize computers -- they hate it

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Text height

    I was looking at that, and it seems to be the "em-size"... which isnt necessarily the same size in pixels... trying to find a way to convert em-size to pixels... I don't think the two are quite the same... but it may still work... i think the em-size unit might already be set to pixel for the font object...

  5. #5
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Text height

    It seems that the em-size of a font is in "points" (hence, 8pt, 12pt, etc), which aren't actually pixels. 1 point = 1/72 of an inch. So pixels are actually an entirely different thing...

  6. #6

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: Text height

    Yeah, but if you use the height of the font object it returns the line spacing of the font in pixels as integer.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  7. #7
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Text height

    lol I totally overlooked that

  8. #8

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: Text height

    no problem. thanks for all your help.
    Don't anthropomorphize computers -- they hate it

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