Change the Textbox height?

后端 未结 21 2196
心在旅途
心在旅途 2020-12-09 07:24

How do I change the height of a textbox ?

Neither of the below work:

this.TextBox1.Size = new System.Drawing.Size(173, 100);
         


        
相关标签:
21条回答
  • 2020-12-09 08:10

    I think this should work.

    TextBox1.Height = 100;
    
    0 讨论(0)
  • 2020-12-09 08:11

    There are two ways to do this :

    • Set the textbox's "multiline" property to true, in this case you don't want to do it so;
    • Set a bigger font size to the textbox

    I believe it is the only ways to do it; the bigger font size should automatically fit with the textbox

    0 讨论(0)
  • 2020-12-09 08:11

    Just found a great little trick to setting a custom height to a textbox.

    In the designer view, set the minimumSize to whatever you desire, and then completely remove the size setting. This will cause the designer to update with the new minimum settings!

    0 讨论(0)
提交回复
热议问题