ASP.NET Rows 屬性
定義和用法
Rows 屬性用于獲取或設(shè)置 ListBox 中的可見(jiàn)行數(shù)(無(wú)滾動(dòng))。
語(yǔ)法
<asp:ListBox Rows="num" runat="server"> some content </asp:ListBox>
屬性 | 描述 |
---|---|
num | 規(guī)定 ListBox 中的可見(jiàn)行數(shù)(無(wú)滾動(dòng))。 |
實(shí)例
下面的例子設(shè)置了 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>
實(shí)例
- 設(shè)置 ListBox 控件的 Rows 屬性