如何避免通过鼠标指针增加文本框的宽度 [英] How to avoid increasing the width of a textbox by mouse pointer

查看:66
本文介绍了如何避免通过鼠标指针增加文本框的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多行文本框中,我能够拉伸并扩展鼠标指针的高度和宽度。为什么会这样?任何人都可以指导我。下面是我的代码:

 <   asp:TextBox     ID   = < span class =code-keyword> TextBox11    runat   =  server      OnTextChanged   =  TextBox11_TextChanged    TextMode   =  MultiLine  

< span class =code-attribute> style = z-index:1;左:878px;上:250px;位置:绝对;身高:25px;宽度:160px > < / asp:TextBox >





谢谢。

解决方案





试试这个,



http:/ /stackoverflow.com/questions/6097270/how-can-i-make-a-textbox-control-that-is-multiline-not-be-resizable [ ^ ]



asp.net multiline textbox [ ^ ]

修改后的代码:



 <   asp:TextBox     ID   =  TextBox11    runat   =  server    TextMode   =  MultiLine  

style = z-指数:1;左:878px;上:250px;位置:绝对;身高:25px; width:160px CssClass = text > < / asp:TextBox >







Css:



 <   head     runat   = 服务器 >  
< title > 您的页面< / title >
< style type = text / css >
.text
{
resize:none;
}

< / style >
< / head >


将样式设置为



style =resize:none;对于文本框


In multiline textbox I am able to pull and expand its height and width my mouse pointer. Why is it so? Can anyone guide me. Hereunder is my code:

<asp:TextBox ID="TextBox11" runat="server"  OnTextChanged="TextBox11_TextChanged" TextMode="MultiLine"

        style="z-index: 1; left: 878px; top: 250px; position: absolute; height: 25px; width: 160px"></asp:TextBox>



Thanks.

解决方案

Hi,

Try this,

http://stackoverflow.com/questions/6097270/how-can-i-make-a-textbox-control-that-is-multiline-not-be-resizable[^]

asp.net multiline textbox[^]


Modified Code:

<asp:TextBox ID="TextBox11" runat="server" TextMode="MultiLine"

        style="z-index: 1; left: 878px; top: 250px; position: absolute; height: 25px; width: 160px" CssClass="text"></asp:TextBox>




Css:

<head runat="server">
    <title>Your Page</title>
    <style type="text/css">
    .text
    {
        resize:none;
    }

    </style>
</head>


Set style attibute as

style="resize:none;" for the textbox


这篇关于如何避免通过鼠标指针增加文本框的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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