Latest web development tutorials

ASP.NET ListBox Rows 屬性

ListBox 控件 ListBox控件

定義和用法

屬性用於獲取或設置ListBox 中的可見行數(無滾動)。

語法

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

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


實例

下面的實例設置ListBox 控件的Rows 屬性:

<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>

演示實例»

ListBox 控件 ListBox控件