Amir Tofighi
Amir Tofighi

Reputation: 21

Set height of richedit to skip scrollbar

How can I change the height of A richedit, so that the text is fully displayed and the scrollbar disapears. Thanks

Upvotes: 1

Views: 400

Answers (1)

fpiette
fpiette

Reputation: 12292

You can assign the RichEdit height property so that it is big enough.

RichEdit1.Height := Max(MinHeight, RichEdit1.Lines.Count * LineHeight);

MinHeight is the minimum heigth you accept (for example empty RichEdit). LineHeight is the mean heigth of the lines. Depends on the font height and content of the RichEdit which is potentially highly variable.

The question you have not asked "How to get text extent in a RichEdit" is answered here.

Upvotes: 1

Related Questions