日期:2014-05-17  浏览次数:20383 次

TextBox 自适应高度?
定义style="OVERFLOW-Y: visible; WIDTH: 90%" 无效,请问有什么好的简便方式吗?

------解决方案--------------------
Dim g As Graphics = Me.CreateGraphics
TextBox1.Height = g.MeasureString(TextBox1.Text, TextBox1.Font).Height()
或者
<asp:TextBox ID="id" style="overflow-y:visible;" TextMode="multiLine" runat="server"></asp:TextBox>
------解决方案--------------------

C# code


TextBox的ID.Attributes.Add("style","width:100%;overflow:visible")

------解决方案--------------------
参考