文本框和大小。 [英] textbox and size.

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

问题描述

是否可以在文本框中设置动态大小?如果上下文只有一行

行,则该行只有一行,但如果上下文为10行,则

框调整为此?


/ Per W.

解决方案

将Multiline属性设置为true。


-

HTH,


Kevin Spencer

Microsoft MVP

软件开发部
http://unclechutney.blogspot.com


你可以离开的任何经验

是一个很好的经历。


" Per W." < pe ** @ tiscali.nowrote in message

news:ej ********** @ troll.powertech.no ...


是否可以在文本框上设置动态大小?如果上下文仅为
一行,则该行只有一行,但如果上下文为10行

则该框调整为此?


/ Per W.





" Kevin Spencer" < sp ** @ uce.govskrev i melding

news:eo ************** @ TK2MSFTNGP04.phx.gbl ...
< blockquote class =post_quotes>
将Multiline属性设置为true。



i已经做到了,但是我希望盒子的高度可以调整到框中的数字

,我不想要使用滚动条。也许我可以计算

的行数,并在有多少行之后设置高度。


/ Per W.

On Fri,2006年11月17日22:41:46 +0100,Per W.写道:


" Kevin Spencer" < sp ** @ uce.govskrev i melding

news:eo ************** @ TK2MSFTNGP04.phx.gbl ...
< blockquote class =post_quotes>
>将Multiline属性设置为true。



i已经做到了,但是我希望盒子的高度调整到盒子里的行数,我不想要使用滚动条。也许我可以计算

的行数,并在有多少行之后设置高度。


/ Per W.



嗯,文本框实际上是一个本机组件,所以我想要的唯一方法是使用SendMessageLong API调用,例如

EM_GETLINECOUNT,用它来计算你需要控制的高度



有点乱,但是当Win32API用于控制渲染时我们有

这个问题的选择很少。


干杯,

小工具


Is it possible to have dynamic size on a textbox? If the context is only one
line then the box is only one line, but if the context is 10 lines then the
box adjust to this?

/Per W.

解决方案

Set the Multiline property to true.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Any experience you can walk away from
is a good one.

"Per W." <pe**@tiscali.nowrote in message
news:ej**********@troll.powertech.no...

Is it possible to have dynamic size on a textbox? If the context is only
one line then the box is only one line, but if the context is 10 lines
then the box adjust to this?

/Per W.




"Kevin Spencer" <sp**@uce.govskrev i melding
news:eo**************@TK2MSFTNGP04.phx.gbl...

Set the Multiline property to true.

i have done that, but i want the height of the box to adjust to the number
of lines in the box, i dont want to use scroll bars. Maybe i can count the
number of lines and set the height after how many lines there is.

/Per W.


On Fri, 17 Nov 2006 22:41:46 +0100, Per W. wrote:

"Kevin Spencer" <sp**@uce.govskrev i melding
news:eo**************@TK2MSFTNGP04.phx.gbl...

>Set the Multiline property to true.


i have done that, but i want the height of the box to adjust to the number
of lines in the box, i dont want to use scroll bars. Maybe i can count the
number of lines and set the height after how many lines there is.

/Per W.

Well, the textbox is actually a native component, so the only way I can
think of is to use the SendMessageLong API call with something like
EM_GETLINECOUNT, and use that to calculate the height you need the control
to be.
A bit messy, but while Win32API is being used for control rendering we have
very little choice in the matter.

Cheers,
Gadget


这篇关于文本框和大小。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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