Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Add ListBox Web Server Controls to a Web Forms Page (Visual Studio) 

The process of adding a ListBox Web server control consists primarily of setting options for how items should be displayed and whether users can select multiple items.

To add a ListBox control to a Web Forms page

  1. From the Standard tab of the Toolbox, drag the ListBox control onto the page.

  2. In the Properties window, set the following properties:

    Property Description

    Rows

    Set to specify how many items should be displayed at once.

    NoteNote

    You can also set the System.Web.UI.WebControls.WebControl.Height property to a pixel value. If you do, it takes precedence over the value of the Rows property. However, not all browsers support the Height property, so you should set the Rows property also.

    SelectionMode

    Set to Single or Multiple to specify how many items users can select.

  3. Create items for the control in one of the following ways:

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.