Properties Rows ของ ASP.NET

การระบุและการใช้งาน

Properties Rows ใช้เพื่อได้รับหรือตั้งค่าจำนวนบรรทัดที่เห็นได้ใน ListBox (ไม่มีการเลื่อน)

รูปแบบการใช้

<asp:ListBox Rows="num" runat="server">
some content
</asp:ListBox>
Properties คำอธิบาย
num กำหนดจำนวนบรรทัดที่เห็นได้ใน ListBox (ไม่มีการเลื่อน)

ตัวอย่าง

ตัวอย่างด้านล่างนี้ตั้งค่า Properties ของ 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>

ตัวอย่าง

ตั้งค่า Properties ของ ListBox Control