ComboBox Text addings
Brought to you by:
maxkleiner
A useful and common trick for comboboxes is to add a
new element to the list when a user enters some text
and presses the enter key:
procedure T_DWSForm.cBox1KeyPress(sender: TObject;
var key: Char);
begin
if key = chr(13) then
with sender as TComboBox do
if(text <> '') and (items.IndexOf(text) < 0) then
items.Add(text);
end;