asp.net listbox horizontal scrollbar
listbox-horizontal-scrollbar.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string[] birds = {
"Antenna Satinbird",
"Slaty-headed Longbill",
"Saddleback",
"Eastern Whipbird",
"Spotted Quail-thrush",
"Varied Lorikeet",
"Musk Lorikeet"
};
ListBox1.DataSource = birds;
ListBox1.DataBind();
ListBox1.Rows = ListBox1.Items.Count;
ListBox1.BorderWidth = 0;
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>asp.net listbox horizontal scrollbar</title>
<style type="text/css">
.block {
display:inline-block;
vertical-align:top;
overflow-x:scroll;
overflow-y:hidden;
border:solid grey 1px;
width:200px;
}
.block select {
padding:10px;
margin:-5px -20px -5px -5px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
asp.net example - listbox horizontal scrollbar
</h2>
<hr width="550" align="left" color="Gainsboro" />
<br />
<div class="block">
<asp:ListBox
ID="ListBox1"
runat="server"
AutoPostBack="true"
Font-Size="X-Large"
SelectionMode="Multiple"
Font-Names="Comic Sans MS"
>
</asp:ListBox>
</div>
</div>
</form>
</body>
</html>


- How to set ListBox alternate item text and background color
- How to apply alternating row color in a ListBox
- How to change ListBox item background color
- How to get ListBox multiple selected items
- How to count ListBox selected items
- How to remove selected items from ListBox
- How to set default selected items in a ListBox
- How to disable specific items in a ListBox
- How to check whether an item exists in a ListBox
- How to add attributes to a ListBox items