similar thread about this이 있습니다. 하지만 자동 너비 (더 큰 행에 맞게 너비가)와 함께 여러 줄 TextBox를 갖고 싶습니다. 당신의 도움에 대한 자동 텍스트 상자 너비
txt1.Rows= text.Split("|").Length ' Sets number of rows but with low performance
txt1.Text = text.Replace("|", Environment.NewLine)
다시 한번 감사 :
이 코드와 나는
<div style="float:left; white-space:nowrap ">
<asp:TextBox style="display:inline; overflow:hidden"
ID="txt1"
runat="server"
Wrap="false"
ReadOnly="true"
TextMode="MultiLine"
BorderStyle="none"
BorderWidth="0">
</asp:TextBox>
</div>
<div style="float:left">
<asp:TextBox ID="txt2" runat="server" Text="Example textbox"></asp:TextBox>
</div>
코드 뒤에 여러 줄로 구성된 TextBox (자동 높이)를 가질 수있다. 당신은 당신이 자동 크기 플러그인 보라, JQuery와 같은 을 플러그인을 사용하여 열려있는 경우
string[] rows = text.Split('|');
int maxLength = rows.Max(x => x.Length);
txt1.Rows = rows.Length;
txt1.Columns = maxLength;
멋진 팁 nunespascal,하지만 jQuery, 감사를 사용할 수 없습니다. – Coyolero