private void ThreadSafeAddItemToLog(ListBox listBox, object value) { listBox.UIThread(delegate { listBox.Items.Add(value); // scroll to last item listBox.SelectedIndex = listBox.Items.Count - 1; }); }