Wanli Ma
Legend Microsystems, Inc.
http://www.LegendNet.com
mailto:in...@LegendNet.com
Var
format: TCharFormat; { defined in Unit RichEdit }
FillChar( format, sizeof(format), 0);
With format Do Begin
cbSize:= Sizeof(format);
dwMask:= CFM_OFFSET;
yOffset:= 60;
{ superscript by 60 twips, negative values give subscripts}
End;
richedit1.Perform( EM_SETCHARFORMAT, SCF_SELECTION,
LongInt(@format));
The message affects the current selection. EM_GETCHARFORMAT can be used to
get the style set of the current selection into a TCharformat variable. You
check for sub/superscript by first testing
If (format.dwMask and CFM_OFFSET) <> 0 Then
...check format.yoffset for sign of offset
Note that richedit mark 1 (the version wrapped by Delphi's TRichedit) does
not automatically adjust the line spacing if you offset characters from the
baseline, and there is no way to change the line spacing from code. I don't
know if the newer richedit version 2.0 (there are wrappers on the Delphi
Super page, i think) handles this any better.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitely requested!
Wanli Ma
Legend Microsystems, Inc.
http://www.LegendNet.com
mailto:in...@LegendNet.com
Wanli Ma wrote in message <36070588...@LegendNet.com>...
>Any idea, it is not included in standard style list, thanks!
>