3

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.

6 Answers 6

5

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

0
1

Two ways:

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

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.

0

You should Dock them in each panel.

1
  • This is only true if the text boxes fill the panels they are children of. Jan 22, 2010 at 20:46
0

Very late to the party but all I did was set dock to fill and Multiline to true and it filled the space.

-1

Just set the TextBox style like this

.MultiLineTextBox
        {
            max-height: 52px;
            max-width: 163px;
            min-height: 52px;
            min-width: 163px;
        }
<asp:TextBox ID="txtremark" runat="server" CssClass ="MultiLineTextBox"

and enjoy.

1
  • 1
    The question asks about WinForms, not ASP.net
    – yumaikas
    Nov 15, 2013 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.