Drop Down Vs List Box in AVS
Drop Down Vs List Box in AVS
Listboxes and dropdowns are compact UI controls that allow users to select options. Listboxes
expose options right away and support multi-selection while dropdowns require a click to see
options and support only single-selection
Listboxes
In their simplest form, a listbox contains three main parts: a container box, a list of items, and
a label. Users can click on the items enclosed in the container box to select one or many from
the list. A listbox may scroll, depending on how many items it contains and the viewable area.
Sometimes, listboxes include checkboxes to clearly imply that multiselect functionality is
available. More complex listboxes allow users to resize the container box, reorder the list of
items, and make selections by moving items from one listbox to another.
There are 2 variations of listboxes that can be classified according to selection type. Each of
these listboxes can be scrollable or not.
Single-select listbox: With this type of listbox, users can select only one item from a list of
mutually exclusive options.
Multiselect listbox: Users can select or deselect one or more items by holding down
the Shift, Command, or Control key while clicking on items.
str = ""
Dim i As Integer
For i = 0 To ListBox1.Items.Count - 1
End If
Next
TextBox3.Text = str
End Sub
Copyright by Dr Ashoksinh Solanki(CASPS-2023) Subject:505-ASP.NET Page 1
Add and Remove Items from ListBox
ListBox1.Items.Add("MCOM")
End Sub
'remove item
'ListBox1.Items.Remove("MCOM")
ListBox1.Items.RemoveAt(2)
End Sub
Dropdown Lists
In their simplest form, dropdown lists contain four main parts: a container box, a downward-
facing arrow button, a list of items, and a label. Users can click on the down-arrow to display a
list of mutually-exclusive items from which they can select only one. Like listboxes, dropdowns
may scroll depending on how many items they contain when expanded. With dropdown lists,
the selected option or default value remains visible in the container box, while the other list
items appear only after clicking on the down-arrow. Selecting an item or clicking outside of the
dropdown list will close it.
We can use ADD method to add items dynamically in selection boxes such as dropdown,
listbox as follows.
ListBox1.Items.Add("MCOM")
End Sub
DropDownList1.Items.Add("PURPLE")
End Sub
DropDownList1.Items.Remove("BLACK")
End Sub