C# 中的多行文本框调整大小

发布于 2024-08-19 01:45:09 字数 121 浏览 3 评论 0原文

我有两个多行文本框在 splitContainer 中分开。当我向左或向右拖动分隔符时,我希望文本框相应地调整大小。我该怎么做?我正在使用 Microsoft Visual C# 2008 Express Edition。谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

一刻暧昧 2024-08-26 01:45:09

如果将文本框的 Dock 属性设置为 Dock.Fill,则应该会发生这种情况。

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

红玫瑰 2024-08-26 01:45:09

两种方法:

  1. 将 Textbox.Anchor 属性设置为 Top、Left、Bottom 和 Right。
  2. 将 Textbox.Dock 属性设置为 Fill。

Two ways:

  1. Set the Textbox.Anchor property to Top, Left, Bottom and Right.
  2. Set the Textbox.Dock property to Fill.
寒尘 2024-08-26 01:45:09

我相信您需要做的就是将锚点属性设置为“上”、“左”、“下”、“右” true。

控制..::.锚点属性

获取或设置边缘
控件绑定到的容器
并确定控件的方式
与其父级一起调整大小。

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.

感情洁癖 2024-08-26 01:45:09

您应该将它们停靠在每个面板中。

You should Dock them in each panel.

吲‖鸣 2024-08-26 01:45:09

参加聚会已经很晚了,但我所做的只是将码头设置为填充,并将多行设置为真,它填充了空间。

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

々眼睛长脚气 2024-08-26 01:45:09

只需像这样设置 TextBox 样式

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

即可享受。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文