Table of Contents
ListBox Properties

The properties of the ListBox class are listed below. For a complete list of ListBox class members, see the ListBox Members topic.

Properties
Name Description
AccessKey (inherited from WebControl) 
Adapter (inherited from Control) 
AllowMultiSelect Gets or sets a boolean value indicating whether more than one item can be selected.
AlternateItemStyle Gets or sets the style properties for alternating list box items.
AppRelativeTemplateSourceDirectory (inherited from Control) 
Attributes (inherited from WebControl) 
AutoPostBack Gets or sets a value indicating whether an automatic postback to the server occurs when an item is selected.
BackColor Gets or sets the background color.
BodyStyle Gets or sets the style properties for the body section.
BorderColor Gets or sets the border color.
BorderImages (inherited from WebControl) Provides a list of images used to create customized borders for the control.
BorderStyle Gets or sets the borders style.
BorderWidth Gets or sets the border width.
ChildControlsCreated (inherited from Control) 
ClientID (inherited from Control) 
ClientIDMode (inherited from Control) 
ClientIDSeparator (inherited from Control) 
ClientSideOnError (inherited from WebControlBase) Gets or sets the name of the JavaScript function that is called when an error occurs on client side.
ClientSideOnEvalVar (inherited from WebControl) Specifies the name of client side JavaScript function which is called when a variable needs to be evaluated in a client template.
ClientSideOnItemOver Gets or sets the name of the client side function to be called when mouse is over a list box item.
ClientSideOnItemSelected Gets or sets the name of the client side JavaScript function to be called when an item is selected.
ClientSideOnLoad (inherited from WebControlBase) Gets or sets the name of the JavaScript function that is called when the control is loaded on the client side.
ClientSideOnMessage (inherited from WebControlBase) Gets or sets the name of the JavaScript function that is called when the control displays a message.
ClientSideOnUnload (inherited from WebControlBase) Gets or sets the name of the JavaScript function that is called when the control is unloaded on the client side.
Context (inherited from Control) 
Controls (inherited from Control) 
ControlSkinID (inherited from WebControl) Specifies the ID of the skin used by this control.
ControlStyle (inherited from WebControl) 
ControlStyleCreated (inherited from WebControl) 
CssBlock (inherited from WebControl) Specifies the CSS style definition used by this control.
CssClass Gets or sets the CSS class name of the control.
CssFile (inherited from WebControl) Specifies the path of an external CSS file that provides CSS styles used by this control.
DataIconField Gets or sets the field of the data source that provides list box item icon.
DataItem (inherited from DataBoundControl) The current data item during data binding.
DataItemContainer (inherited from Control) 
DataKeysContainer (inherited from Control) 
DataSource (inherited from DataBoundControl) Gets or sets the data source used by the control.
DataSourceID (inherited from DataBoundControl) Gets or sets the ID of this control's data source object. Used in .NET 2.0 only.
DataTextField Gets or sets the field of the data source that provides the list box item text.
DataValueField Gets or sets the field of the data source that provides list box item value.
DesignMode (inherited from Control) 
DesignOptions (inherited from WebControl) Contains options used for design time preview.
DisabledItemStyle Gets or sets the style properties for disabled list box items.
Enabled (inherited from WebControl) 
EnableKeyboardNavigation (inherited from WebControl) Gets or sets a value indicating whether keyboard navigation should be enabled.
EnableTheming (inherited from WebControl) 
EnableViewState (inherited from Control) 
Events (inherited from Control) 
Font (inherited from WebControl) 
FooterContainer Gets the container control for the footer.
FooterStyle Gets or sets the style properties for the footer section.
FooterTemplate Gets or sets the ITemplate that defines how the footer section of the ListBox control is displayed.
ForceSSL (inherited from WebControl) Gets or sets a value indicating whether the server should work as if it were always running on a secure server (https).
ForeColor Gets or sets the foreground color.
HasAttributes (inherited from WebControl) 
HasChildViewState (inherited from Control) 
HeaderContainer Gets the container control for the header.
HeaderStyle Gets or sets the style properties for the header section.
HeaderTemplate Gets or sets the ITemplate that defines how the header section of the ListBox control is displayed.
Height (inherited from WebControl) 
ID (inherited from Control) 
IdSeparator (inherited from Control) 
ImageBaseDirectory (inherited from WebControl) Gets or sets the folder that contains images for the control.
IsChildControlStateCleared (inherited from Control) 
IsEnabled (inherited from WebControl) 
IsTrackingViewState (inherited from Control) 
IsViewStateEnabled (inherited from Control) 
ItemHoverStyle Gets or sets the style properties for a list box item when mouse is over the item.
ItemListStyle Gets or sets the style properties for the item list.
Items Gets the items collection.
ItemStyle Gets or sets the style properties for list box items.
ItemTemplate Gets or sets the ITemplate that defines how items in the ListBox control are displayed.
ListBoxStyle Gets or sets the style properties applied to the ListBox control.
LoadingItemsHtml Gets or sets the text displayed when the list box is loading additional items.
LoadViewStateByID (inherited from Control) 
MoreItemsMessageFormat Gets or sets the text used to format the message that indicates more items are available.
MoreItemsMessageStyle Gets or sets the style properties used by the message that indicates more items are available.
MultiSelectModifier Gets or sets the modifier key for selecting multiple items.
NamingContainer (inherited from Control) 
NoMoreItemsMessageFormat Gets or sets the text used to format the message that indicates no more items are available.
Parent (inherited from Control) 
RenderingCompatibility (inherited from Control) 
RightToLeft (inherited from WebControl) Gets or sets a value indicating whether the control should renders as right to left.
SelectedIndex Gets or sets the index specifying the currently selected item.
SelectedItem Gets the first selected item.
SelectedItems Gets a collection containing all the selected items in the list box.
SelectedItemStyle Gets or sets the style properties for selected list box items.
Shortcut (inherited from WebControl) Get a Shortcut object through which you can get or set the keyboard short cut for this control.
Site (inherited from Control) 
SkinID (inherited from WebControl) 
Style (inherited from WebControl) 
SupportsDisabledAttribute (inherited from WebControl) 
TabIndex (inherited from WebControl) 
TagKey (inherited from WebControl) 
TagName (inherited from WebControl) 
TemplateControl (inherited from Control) 
TemplateSourceDirectory (inherited from Control) 
ToolTip (inherited from WebControl) 
TotalItemCount Gets or sets the total item count.
UniqueID (inherited from Control) 
ValidateRequestMode (inherited from Control) 
ViewState (inherited from Control) 
ViewStateIgnoresCase (inherited from Control) 
ViewStateMode (inherited from Control) 
Visible (inherited from Control) 
Width (inherited from WebControl) 
See Also