Latest web development tutorials

ASP.NET ListBox Rows property

ListBox Control ListBox Control

Definition and Usage

ListBox property is used to get or set the number of visible lines (no scrolling).

grammar

<asp:ListBox Rows="num" runat="server">
Some Content
</asp:ListBox>

属性 描述
num 规定 ListBox 中的可见行数(无滚动)。


Examples

The following examples set the Rows property of the ListBox control:

<form runat="server">
<asp:ListBox id="lb1" Rows="5" runat="server">
<asp:ListItem Value="Item1" />
<asp:ListItem Value="Item2" />
<asp:ListItem Value="Item3" />
<asp:ListItem Value="Item4" />
<asp:ListItem Value="Item5" />
</asp:ListBox>
</form>

The demonstration >>

ListBox Control ListBox Control