|
-
Feb 8th, 2006, 11:36 PM
#1
Thread Starter
Frenzied Member
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
-
Feb 8th, 2006, 11:38 PM
#2
Re: Text height
Can't you just get the font size of the grid?? And compare it to the row height?
-
Feb 8th, 2006, 11:39 PM
#3
Thread Starter
Frenzied Member
Re: Text height
I just found the height property of a font object. Thanks.
Don't anthropomorphize computers -- they hate it
-
Feb 8th, 2006, 11:47 PM
#4
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...
-
Feb 9th, 2006, 12:07 AM
#5
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...
-
Feb 9th, 2006, 12:10 AM
#6
Thread Starter
Frenzied Member
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
-
Feb 9th, 2006, 12:17 AM
#7
Re: Text height
lol I totally overlooked that
-
Feb 9th, 2006, 12:18 AM
#8
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|