Skip to content

CreateListBox

Claude edited this page Oct 27, 2026 · 6 revisions
BlitzPlus

CreateListBox

CreateListBox:Int32 x:Int32, y:Int32, width:Int32, height:Int32, group:Int32, style:Int32=0
Parameter Type Default Description
x Int32 required Horizontal position inside the group.
y Int32 required Vertical position inside the group.
width Int32 required Width of the list.
height Int32 required Height of the list.
group Int32 required Window, panel, tabber or canvas that holds it.
style Int32 0 0, or 65536 to not follow the group when it is resized. Defaults to 0.

Returns: A handle for the list box.

Description

Makes a list of entries from which the user can pick one. A scroll bar appears when there are more entries than fit. Clicking an entry sends $401 with the gadget as the source, and the entry is given by SelectedGadgetItem.

Differences

  • Only one entry can be selected at a time.

Examples

Graphics 320, 240, 32, 2
win  = CreateWindow("Fruit", 10, 10, 300, 200, Desktop(), 3)
list = CreateListBox(10, 10, 160, 110, win)
AddGadgetItem list, "Apple"
AddGadgetItem list, "Banana"
AddGadgetItem list, "Cherry"
AddGadgetItem list, "Grape"
Repeat
	e = WaitEvent()
	If e = $401 Then SetGadgetText win, "Chose " + GadgetItemText(list, SelectedGadgetItem(list))
Until e = $803

Media

CreateListBox

Related Commands

CreateButton, CreateComboBox, CreateLabel, CreatePanel, CreateProgBar, CreateSlider, CreateTabber

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally