winforms - 将 WinForms TextBox 更改为 BorderStyle.None 会导致文本被截断

标签 winforms

我换了一个 WinForms TextBox控制没有边界。

当我这样做时,框中文本的底部像素行被切断。

顶部: BorderStyle.Fixed3D (默认)。 底部: BorderStyle.None
enter image description here

您可以看到无边框文本框中的最后一位文本被截断了:

enter image description here

我如何说服 TextBox (谁的高度不能改变),它需要更高?

最佳答案

AutoSize属性在那里,只是继承自 TextBox您可以前往该属性(property):

public class TextBoxEx : TextBox {

  public TextBoxEx() {
    base.AutoSize = false;
  }

}

关于winforms - 将 WinForms TextBox 更改为 BorderStyle.None 会导致文本被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8481333/

相关文章:

C#: 'System.StackOverflowException' 出现在 mscorlib.dll 中

c# - 为什么按钮会闪烁?

c# - 生成颜色渐变

c# - 更改窗口标题中的光标

c# - WinForms ListView.HideSelection 属性没有效果?

c# - 以编程方式格式化 USB 驱动器

c# - 如何在程序中快速加载XML?

c# - 两种方式绑定(bind)到用户设置?

c# - 如何应用图形缩放并转换为 TextRenderer

c# - 无法通过嵌套类型 'FormMain' 访问外部类型 'FormMain.ImageDelegateClass' 的非静态成员