TListBox sync with TStringList
I've got a background thread sending messages to the main thread which, in
turn, adds the messages to a TListBox like a log.
Thing is, this background thread is really fast and I dont really need to
update the log that fast. I'd like to add the messages to a TStringList
and set a timer to update the TListBox every second or so.
I've tried using:
listBox1.Items := StringList1;
or
listBox1.Items.Assign(StringList1);
in the OnTimer event and it works. Thing is, it never let's the user
really scroll or click the listbox, because it refreshes every second.
I'm using Delphi XE4
Is there a more elegant way to sync the contents of the listbox with this
background StringList (or any other list if necessary)? Thank you in
advance!
No comments:
Post a Comment