ASP.NET RowsPropriété


ListBox 控件Contrôle ListBox

Définition et utilisation

La propriété est utilisée pour obtenir ou définir le nombre de lignes visibles (sans défilement) dans le ListBox.

Syntaxe

<asp:ListBox Rows="num" runat="server">
Un contenu
</asp:ListBox>

Propriété Description
num Spécifie le nombre de lignes visibles (sans défilement) dans le contrôle ListBox.


Exemple

L'exemple suivant définit la propriété Rows du contrôle ListBox :

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

Démo »

ListBox 控件Contrôle ListBox Autres extensions