How to dynamically resize a textbox in C#

后端 未结 4 1238
情书的邮戳
情书的邮戳 2020-12-22 02:23

I am new to C# user interface. I have created a window as shown in the first image. But if the user drag the window and make it bigger, I would like for it to make each

4条回答
  •  -上瘾入骨i
    2020-12-22 03:14

    You can add a TableLayoutPanel to your Form. Per default this panel has two columns and two rows.

    Then you add one TextBox to each cell and set the Dock-Property of each TextBox to Fill.

    The last step thing to do is either set the Dock-Property of your TableLayoutPanel to Fill or set the Anchor-Property of your TableLayoutPanel to Left | Right | Bottom | Top. Then your panel will be resized together with the Form.

    All these steps can be done with the designer.

提交回复
热议问题