多行文本框文字换行 [英] Multiline Textbox text wraping

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

问题描述

我有一个asp.net多行文本框.当我在其中填充连续文本时,控件将被扩展.我无法提供固定宽度,因为在设计宽度中指定为%

现在,我应该停止扩展控件.

 <   asp:TextBox     ID   ="   ="span>    TabIndex   ="  35" 
              runat   ="     MaxLength   ="    宽度  ="  96%"  TextMode    MultiLine"   ="  >> 
 <  /asp:TextBox  >  



我会给你一个前来说,我有文本"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",因为此连续文本,控件在宽度上的扩展程度超过了%,这是我的确切问题.

M.Ravibalaji,

您可以将"文本换行"或"自动换行"样式应用于文本框,也可以将带有文本自动换行"或自动换行"样式的div标签并将您的文本框放在该div标签中.

例如style ="自动换行:断词;"

希望对您有帮助.

问候,
Ambicaprasad Maurya


我们已使用一种方法解决了此问题,该方法将显示某些字符或单词,并在悬停时将整个文本显示为工具提示或某些模式弹出窗口.
显示诸如"AAAAAAAAAAAAAAAAAAAAAA...."之类的裁剪文本,并将其悬停时显示整个文本.
不知道您的客户是否同意这种设计更改,您可以尝试.


M.Ravibalaji,


我已经给您上面提到的代码一个真正的尝试,我发现它应该工作.它没有得到扩展.我建议您检查此代码框中是否附有任何样式信息.您也可以尝试将其放入DIV中.

希望这会有所帮助!!

快乐编码:)


I have a asp.net Multiline textbox. When I populate a continuous text in that then the control is getting expanded. I could not give a fixed width because in design width is specified as %

Now i should stop the control geting expanded.

<asp:TextBox ID="txtProperShippingName" TabIndex="35"

      runat="server" MaxLength="120" Width="96%" TextMode="MultiLine" Rows="3">
 </asp:TextBox>



I will give u an ex say i have text "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" now this is continuous text because of this continuous text the control is getting expanded more over width is specified in % this is my exact problem

解决方案

Hi M.Ravibalaji,

You can apply "text-wrap" or "word-wrap" styles to your textbox or put a div tag with "text-wrap" or "word-wrap" styles and put your textbox in that div tag.

e.g. style="word-wrap: break-word;"

Hope this will help you.

Regards,
Ambicaprasad Maurya


We had resolved this issue using a method, which would display certain charaters or words and on hover, display whole text as a tooltip or some modal popup.
Display cropped text like "AAAAAAAAAAAAAAAAAAAAAA...." and on hover of it display the whole text.
Not sure if your customer would agree to this design change, you can however try.


Hi M.Ravibalaji,


I''ve given your above mentioned code a real try & I found this working as it should. It''s not getting expanded. I advise you to check your code if any style information you''ve attached to this text box. You can also try putting this inside a DIV.

Hope this helps !!

Happy Coding :)


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

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