Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing WinForms TextBox to BorderStyle.None causes text to be cut off

Tags:

winforms

i've changed a WinForms TextBox control to have no border.

When i do the bottom pixel row of text in the box is being cut off.

Top: BorderStyle.Fixed3D (default). Bottom: BorderStyle.None

enter image description here

You can see the last bit of text in the un-bordered text box is cut off:

enter image description here

How do i convince a TextBox (who's height cannot be changed), that it needs to be taller?

like image 666
Ian Boyd Avatar asked Nov 25 '22 06:11

Ian Boyd


1 Answers

The AutoSize property is there, just inherit from TextBox and you can get to the property:

public class TextBoxEx : TextBox {

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

}
like image 85
LarsTech Avatar answered May 26 '24 18:05

LarsTech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!