开发者

How do I stop a user from incresing the height of TextBox

开发者 https://www.devze.com 2023-02-24 05:41 出处:网络
I have an <asp:TextBox TextMode=\"MultiLine\" Height=350 Width=\"200\"> and have elements around it.

I have an <asp:TextBox TextMode="MultiLine" Height=350 Width="200"> and have elements around it.

I don't want to allow the user to change the height and width of t开发者_开发百科he asp:TextBox because it messes with the alignment of other elements around it.

Solution?


[Answer added for future reference]

You can use resize: none; in CSS to disable the resize-functionality offered by Firefox/Safari. An example and explanation can be found here.

(thanks to BoltClock)


If you want to add it in your textbox tag, you can do it like this:

<asp:TextBox ID="TextBox7" runat="server" MWidth="245px" Height="245px" 
      TextMode="MultiLine" style="resize:none"></asp:TextBox>
0

精彩评论

暂无评论...
验证码 换一张
取 消