如何 - 要设置一个文本框的高度? [英] How-To set Height of a Textbox?

查看:173
本文介绍了如何 - 要设置一个文本框的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我单行文本框,我设置为BORDER =无。上这样做,高度变成非常小。我不能programamtically设置文本框的高度。如果我设置任何边界,然后再它的很好,但我不希望任何边界。连文是不可见完全 - 所以字体大小已经是更大的文本框高度

For my single line Textbox, I set is Border = None. On doing this, the height turns very small. I can't programamtically set the height of the textbox. If I set any border, then again its fine, but I don't want any border. Even the text is not visible completely - so the font size is already bigger the the textbox height.

我试图创建一个自定义文本框,并设置它的高度,但它没有任何效果。如何处理这种情况?任何帮助高度赞赏。

I tried creating a custom textbox, and set the Height of it, but it has no effect. How to handle this situation? Any help is highly appreciated.

推荐答案

我刚刚创建这种情况下,一个空项目,并没有看到你所描述的结果

I just created this case in an empty project and don't see the result you are describing.

在边框样式是没有的,文本框自动调整大小来选择字体的显示区域。如果我再设置多行= TRUE,我可以改变大小属性和变化棍棒的高度部分。

When the BorderStyle is none, the display area of the Textbox auto-sizes to the font selected. If I then set Multiline = true, I can change the height portion of the Size property and the change sticks.

也许你的代码的另一部分修改的高度? ?resize事件处理函数也许

Perhaps another portion of your code is modifying the height? A resize event handler perhaps?

我的建议:


  • 发布的有关部分你的代码

  • 尝试重现该问题在一个空的WinForms项目(如我只是做了)

这篇关于如何 - 要设置一个文本框的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆