views:

434

answers:

4

Hello. I have two multiline textboxes separated within a splitContainer. When I drag the splitter left or right I would like the textboxes to resize accordingly. How do I do this? I am using Microsoft Visual C# 2008 Express Edition. Thanks.

A: 

Hi Jim,

I believe all you need to do is set the anchor property to Top, Left, Bottom, Right true.

Control..::.Anchor Property

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.

Chris Kannon
+1  A: 

If you set the Dock property of textboxes to Dock.Fill, this should happen for you.

codekaizen
Thanks for the tip, kaizen!
Jim Fell
A: 

You should Dock them in each panel.

Austin Salonen
This is only true if the text boxes fill the panels they are children of.
Chris Kannon
A: 

Two ways:

  1. Set the Textbox.Anchor property to Top, Left, Bottom and Right.
  2. Set the Textbox.Dock property to Fill.
Ken