ImageEn, unit iexRichEdit

TIERichEdit.TextSize

TIERichEdit.TextSize


Declaration

function TextSize(MaxWidth: Integer = 0; AllowWrapping: Boolean = True): TSize;


Description

Returns the size (in pixels) of the content of the control.
MaxWidth specifies the maximum allowable width (in pixels), e.g. you can use the control width.
If MaxWidth = 0, it just returns TextWidth x TextHeight.
If AllowWrapping = True (assumes MaxWidth > 0), the text will be wrapped at the specified width.


Example

// Get the best height for this control, given its current width
sz := IERichEdit1.TextSize( IERichEdit1.Width );
IERichEdit1.Height := sz.Y;