1

Hi when I create a textbox on Visual studio on Windows Form Application, I can get the width more than 20 pixels, however I cannot get the height more than 20 pixels.

So how will I be able to resize height?

Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103
  • I tagged this as [Winforms]. If you use another technology (WPF?), please re-tag the question. – Tomalak May 14 '12 at 06:07
  • 2
    Repeated: http://stackoverflow.com/questions/5853073/change-the-textbox-height – Ivo May 14 '12 at 06:08
  • Then you have it somehow put in some kind of container. Is your Textbox in a TableLayoutPanel or something? Usually you should be able to just adjust the hight like the width. – basti May 14 '12 at 06:11

3 Answers3

4

Set the Multiline property to true in the designer, then you will be able to resize the textbox.

dan radu
  • 2,772
  • 4
  • 18
  • 23
1

You can set Multiline = true, I can change the height portion of the Size property and the change sticks. The display area of the Textbox auto-sizes to the font selected, so you can set the higher font size to increase the size of the textbox, but you are not intend to it.

Multiline = true In this mode the height of the text box can be of any value thus allowing different number of rows in it.

Ref:
How-To set Height of a Textbox?
TextBox cannot adjust height size

Edit: You can customize the TextBox also.

Community
  • 1
  • 1
Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
0

Changing the font size.

If you're using WPF:

<TextBox Height="42"/>
Ceramic Pot
  • 280
  • 2
  • 14
  • I use Windows Form Application – Sarp Kaya May 14 '12 at 06:12
  • ivowiblo's comment is not about the height, it is about the width. I want to change the height. So whenever I try to change it other than 20 it does not resize! – Sarp Kaya May 14 '12 at 06:16
  • 1
    No, it's about the height. Check the title! – Ivo May 14 '12 at 06:17
  • OK I Fixed it by changing Multiline thank you I thought it is something else( I mean your link, I think you've changed it) – Sarp Kaya May 14 '12 at 06:19
  • You can't change the Height property of a Windows Forms TextBox control unless 1) You make it Multiline, 2) You increase the Font size, or 3) You roll your own custom control. – Arrow Oct 28 '12 at 17:31