Change the Textbox height?

后端 未结 21 2218
心在旅途
心在旅途 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:03

    I know this is a kind of old post, but I found myself in this same issue, and by investigating a bit I found out that the Height of a WinForms TextBox is actually calculated depending on the size of the font it contains, it's just not quite equal to it.

    This guy explains how the calculation is done, and how you can set it on your TextBox to get the desired Height.

    Cheers!

提交回复
热议问题