Listbox

=Listbox= toc

Syntax:
LISTBOX #handle, arrayName$, nRows - Add a listbox to the web page with #handle, filled with the contents of arrayName$ and displaying nRows rows or lines within the listbox. If the number of items in the array exceeds nRows then the listbox will scroll.

Dropdown List (like a combobox)
Drop down list - Specify a value for nRows of 1 to cause the listbox to be added to the page as a drop down list.

LISTBOX methods:
> //- returns the value of the listbox selection as a string. If there is no selection then it returns an empty string//
 * 1) handle SELECTION$

> //- Set the current selection to be the item contained in the string variable//
 * 1) handle SELECT(Item$)

Simple Listbox Demo
code format="vbnet" dim a$(10) a$(1)="One" a$(2)="Two" a$(3)="Three" a$(4)="Close" selected$="" [start] listbox #lb,a$,10 print " " link #sel, "[Accept]",[select] wait [select] selected$=#lb selection$ print " " if selected$<>"" then print "You selected ";selected$ else print "No selection made" end if link #con, "[Continue]",[go2] wait [go2] if selected$<>"Close" then cls goto [start] else cls end end if code

Dropdown List (Combobox) Demo
code format="vbnet" 'Cause listbox to be displayed 'as a dropdown list, like a combobox. dim a$(10) a$(1)="One" a$(2)="Two" a$(3)="Three" selected$=""

listbox #lb,a$,1 print link #sel, "Get Selection",[select] wait

[select] selected$=#lb selection$ print print "You selected ";selected$ end code