简体   繁体   中英

C# Winforms Resizing and Controls

Say I have a Winform with 3 adjacent Textboxes, all within a Panel that covers the majority of the form. How can I configure it so that when I resize the form, the controls also resize, but do not bleed into each other? I've tried the different anchoring options, however the textboxes always tend to run into each other?

It's probably something really simple that i've missed.

Thanks.

看一下TableLayoutPanel - 您应该能够使用其中一个具有3列并且每个列中包含文本框的行为来获得所需的行为。

One easy way to accomplish this is to put the three textboxes into a TableLayoutPanel that has 1 row and three columns.

Settings:

  • Set the width of each column to 33%
  • Set the anchor properties of the TableLayoutPanel to Top, Left, Right (or similar).
  • Set the Dock property of each TextBox to Fill.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM