trichview.com

trichview.support




Re: Size TRichView to fit contents?


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/09/2002 11:35:02


Adjusting height by width:


After calling Format, and inside OnChange event, set

RichView.Height := RichView.DocumentHeight + 4 {border} +

RichView.VSmallStep;

(you can set RichView.VSmallStep to 1, before formatting)



> Hi group, Sergey,

>

> We need a way to determine whether the displayed contents fits in a

> TRichView.

> It would already be useful if I could detect if TRichView wants to display

a

> vertical

> scrollbar when it renders its contents off-screen, but better would be a

> method that

> would return the "fitting" Height for the current Width with the current

> content, or vice versa.

>

> The intended application: I have a TRichView with a specific size, I

export

> the RTF,

> I translate the RTF and it grows in size, I import it back into TRichView,

I

> need the

> TRichview to resize to accomodate the new contents.

>

> Any "trick" will do, iterative trying, scrollbar detection tricks, detours

> through Window API's...

> Sergey, do you have a suggestion? Even some internal private field will

do,

> I can hack the source.

>

> Frank de Groot

> XHLP / Oslo

>

>





Powered by ABC Amber Outlook Express Converter