Skip to main content

Combo Box

Overview

Combo Box allows users to select a single option from a drop-down list, or enter new text in the text input box. This control displays the currently selected option. The drop-down list can be expanded or folded by clicking the arrow on the right side of the control.

  • Folded State

    image-20221012170805925

  • Expanded State

    image-20221012170811082

Properties

image-20221012170815878

PropertyDescription
Only SelectSet whether the text input box can be entered.
Dropped DownSet whether the drop-down list of the control is open.

Events

image-20221012170820528

Callback NameCallback Function
on_get_captureThe callback when the control gets mouse focus.
on_lost_captureThe callback when the control loses mouse focus.
on_selectedThe callback after clicking an option.

Lua Script Example

Self.InputEdit.Text = nx_widestr("ComboBox")
Self.DropListBox:AddString(nx_widestr("Button"))
Self.DropListBox:AddString(nx_widestr("CheckButton"))
Self.DropListBox:AddString(nx_widestr("ComboBox))
Self.DropListBox:AddString(nx_widestr("Edit"))
Self.OnlySelect = true
Self.DroppedDown = true

-- The callback function ComboBox_selected will be executed when lect-clicking the Combo Box.
function ComboBox_selected(self)
nx_msgbox("ComboBox_selected")
end