Re: Resize RichTextBox to fit contents

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Stoil Marinov (stoil_marinov.OBVIOUS_at_hotmail.com)
Date: 08/04/04


Date: Wed, 4 Aug 2004 10:22:38 -0500


"Thomas Freeman via .NET 247" <anonymous@dotnet247.com> wrote in message
news:uJhbJ1heEHA.2804@TK2MSFTNGP11.phx.gbl...
Hello there.

Does anyone know of a way I can get either a richTextBox control to tell me
the size of the text it contains. I'm trying to create a control which
automatically resizes to snugly fit its contents. The biggest problem is
that the contents can be pictures and tables - as well as just text. Does
anyone have any ideas?

Also I'd be happy to do a similar thing with a browser object if necessary.

Many Thanks

--------------------------------
From: Thomas Freeman

Hi Thomas,

If you can read VB code (mostly API calls), here is a sample that might give
you some ideas at least as far as text is concerned:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=9m116e%24beglg%241%40ID-24932.news.dfncis.de

Regards,

Stoil