Skip to content

CreateComboBox

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

CreateComboBox

CreateComboBox: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 box.
height Int32 required Height of the closed box.
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 combo box.

Description

Makes a drop-down list. It shows the selected entry and opens the list when clicked. Fill it with AddGadgetItem, and read what was picked with SelectedGadgetItem when a $401 event arrives.

Differences

  • The user cannot type into it, only pick from the list.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Combo", 10, 10, 300, 200, Desktop(), 3)
box = CreateComboBox(10, 10, 160, 24, win)
AddGadgetItem box, "Small"
AddGadgetItem box, "Medium"
AddGadgetItem box, "Large"
SelectGadgetItem box, 0
Repeat
	e = WaitEvent()
	If e = $401 Then SetGadgetText win, "Picked " + GadgetItemText(box, SelectedGadgetItem(box))
Until e = $803

Media

CreateComboBox

Related Commands

CreateButton, CreateLabel, CreateListBox, CreatePanel, CreateProgBar, CreateSlider, CreateTabber

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally