[futurebasic] Re: Getting text info from edit field

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2003 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Mon, 29 Sep 2003 23:34:47 -0400
Barrie asked:

>How can I get the font size of an edit field? I thought I was on the right
>track with the following, but it gave me a wrong number.
>
>DIM AS INT theFontSize
>DIM AS LONG teH
>'
>'
>teH = TEHANDLE (efNum)
>theFontSize = teH..TxSize


Barrie,

Maybe this will help.

Ken


local fn FontSize( whichEF as long )
dim as TextStyle @ theStyle
dim as integer   @ lineHeight, @ fontAscent, offset, size
dim as handle      teH

teH = TEHandle( whichEF )

long if teH
TEGetStyle( offset, theStyle, lineHeight, fontAscent, teH )
size = theStyle.tsSize
xelse
size = -1
end if

end fn = size