Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I increase height of a textbox without Multiline = "true" or incrementing font size?

I need to adjust height of the textbox so it is suitable for touchscreen.

I understand people recommend Multiline = "true" but if I do that, text inside of the box is justified with top which is not proper in my application.

I tried to adjust font size, but the size should be ridiculously huge to fit the height for my need.

Is there any other way to increase the height of textbox?

like image 212
Tae-Sung Shin Avatar asked Apr 10 '12 15:04

Tae-Sung Shin


2 Answers

Try this:

textBox1.AutoSize = false;

It won't show up in the intellisense, but it will work.

To have it work with the designer, you would have to make your own TextBox:

public class TextBoxEx : TextBox {
  public TextBoxEx() {
    this.AutoSize = false;
  }
}
like image 55
LarsTech Avatar answered Oct 21 '22 23:10

LarsTech


Trick steps:

  1. Set the multi-line = true
  2. No need to change the Font size.
  3. change the Max-length . so that it should not enter the next line.
like image 24
Emani Parida Avatar answered Oct 21 '22 22:10

Emani Parida