TComboBox

From OpenEUO
Revision as of 13:28, 14 November 2010 by 76.184.223.222 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A TComboBox component is an edit box with a scrollable drop-down list attached to it. Users can select an item from the list or type directly into the edit box.

Inherited from TWinControl:

Inherited from TControl:

Inherited from TComponent:

Inherited from TObject:

Example:

 cbox = Obj.Create('TComboBox')
 cbox.Parent = form -- set to containing object's name
 cbox.Top = 25
 cbox.Left = 25
 cbox.Width = 180
 cbox.Items.Add('a line in the combo box')
 -- add more lines
 cbox.ItemIndex = 0 -- the first item is selected
 cbox.OnChange = function(pSender)
 --[[ event fires immediately after the user edits the text in the edit
 region or selects an item from the list. The Text property gives the new value in the edit region.
 --]]
 end
 cbox.OnSelect = function(pSender)
 --[[ event fires when user changes the selected item in the drop-down list. OnSelect occurs after
 the selection has changed and the Text property reflects the new item. 
 --]]
 end