默认情况下,多行 TextBox 控件包括垂直滚动条。若要隐藏该滚动条,请包括样式属性 overflow: hidden。例如,在 HTML 视图中,控件的声明性语法会是下面这样:
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 56px; OVERFLOW: hidden; POSITION: absolute; TOP: 72px" runat="server" TextMode="MultiLine"></asp:TextBox> <textarea>、<div>等HTML控件中常用overflow属性。
overflow属性常用值如下: overflow:scroll/hidden/auto/visible scroll:会出现两个方向上的滚动条(但横向滚动条在Wrap属性值为true的情况下没有什么用) hidden:不会出现滚动条,但超控件范围的内容将被剪辑(通过方向键可以看到) auto:若内容超范围则出现滚动条,否则不出现 visible:不会出现滚动条,控件大小会随内容增加而发生改变(内容超控件范围的情况下) 不设置:也就是默认情况下,只显示纵向滚动条 也可以通过右击控件,选择“生成样式”,打开“样式生成器”的“布局”部分做相应调整
来自MSDN: Syntax语法 HTML { overflow : sOverflow } Scripting object.style.overflow [ = sOverflow ] Possible Values可能值 (责任编辑:admin)sOverflow String that specifies or receives one of the following values. visible: Default. Content is not clipped and scroll bars are not added. scroll: Content is clipped and scroll bars are added, even if the content does not exceed the dimensions of the object. hidden: Content that exceeds the dimensions of the object is not shown. auto: Content is clipped and scrolling is added only when necessary. |