Determining size of a window

J

Jim Bancroft

Hi,

I have a RichTextBox I'm displaying in a WinForm. I'm trying to resize
so that the RTB fills the form, but with enough room for its vertical and
horizontal scrollbars. The RTB will be the only control on this form--
think of it as a popup window with text instead of buttons.

I'm having trouble, unfortunately. In my code I resize the WinForm to
match the RTB's "Size" property. Problem is, the scrollbars aren't
accounted for properly when I do this. They're cutoff on the bottom and
side. Would anyone know a good way to resize the form so that the RTB's
scrollbars are taken into account? Thanks!
 
C

Chris Dunaway

Try setting the Dock property of the RTB to Dock.Fill. Then it's size
will be taken care of automatically.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top