更改TextBox的行高? [英] change the line height of TextBox?

查看:223
本文介绍了更改TextBox的行高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows窗体上使用TextBox。

我需要修改行之间的距离而不管此文本框中的字体大小。

是否可以更改行间距?

提前谢谢。

解决方案

TextBox控件中的行间距是固定的,你不能改变它。如果您需要它,请尝试创建自己的控件并自己绘制内容: http://social.msdn.microsoft.com/forums/en-US/winforms/thread/b6311cca-2ac4-4e21-9b74-b4860a719615 [ ^ ]


否。 TextBox控件没有样式选项,除了字体大小 - 适用于整个文本,而不是它的一部分。

您可以使用RichTextBox,通过使用Windows API来实现向控件发送EM_SETPARAFORMAT消息 - 但我从未尝试过,我不知道它会如何工作。



或许,最好的办法就是编写自己的支持它的控件。


I am using a TextBox on a windows form.
I need to modify the distance between lines regardless of font size on this textbox.
Is it possible to change line spacing?
Thanks in advance.

解决方案

Line spacing in the TextBox controls is fixed and you can''t change it. If you need it try creating your own control and painting the contents yourself : http://social.msdn.microsoft.com/forums/en-US/winforms/thread/b6311cca-2ac4-4e21-9b74-b4860a719615[^]


No. The TextBox control has no styling options, other than the font size - which applies to the whole text, and not part of it.
You can probably do it with a RichTextBox, by using the Windows API to send the control an EM_SETPARAFORMAT message - but I''ve never tried and I don''t know how well it would work.

Probably, your best bet is to write your own control that supports it.


这篇关于更改TextBox的行高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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