开发者

Maximize Components Too

I have a Windows Forms application that on it I have a RichTextBox, like this: Window Examp开发者_StackOverflow社区le http://img687.imageshack.us/img687/692/window.png

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?


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.


You can dock it to the form.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜