Jump to content
Nicolò Blunda

Insert an save item in ComboEdit at first position

Recommended Posts

Hi.
I would like to sort the elements in a ComboEdit in the exact order of typing.
That is... the combo should save the typing history of the inserted elements, with the last element in first position and so on...
I don't see the sorted property to set the order of all the elements/items, which are, by default, sorted alphabetically.
How can I do that?

Share this post


Link to post

What keys or click did you use to connect the append.  Under windows code seems to add a line when tabbed?

 

// if you wire up onClick In Events in Object Inspector
procedure TForm13.ComboEdit1Click(Sender: TObject);
begin
  if Sender is TComboEdit then
  begin
    var CE := Sender as TComboEdit;
    CE.Items.Insert(0, CE.text);
    //CE.Items.add(CE.Text);
    //CE.Items.Insert(CE.Items.Count, CE.text);
    CE.Text := '';   //clears for newline
  end;
end;

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×