views:

79

answers:

3

I have a Windows Forms application that on it I have a RichTextBox, like this: Window Example

At this size it's all ok, but if the user maximaze or resize the window, the RichTextBox stays at the same size, but how to resize the RichTextBox too?

+1  A: 

You can dock it to the form.

Darin Dimitrov
A: 

In this case, as Darin Dimitrov said, docking is fine. In more complex layouts, you can set the anchor. That lets controls move relative to the right border instead of the left, for example.

Thomas
+2  A: 

There are two options, docking and anchoring. In this simple form, an anchor is probably easiest. Just select the control, and adjust the Anchor property to Top, Left, Right, and Bottom.

Also, docking and anchoring will behave differently. Choose the one that works best for you.

John Fisher