public override void onMetronomeEvent(object sender, metronomeEventArgs e) { DateTime currDateTime = e.currentTime; if (listBox.InvokeRequired) { addToListbox a = new addToListbox(addIntoListbox); listBox.Invoke(a, currDateTime.ToString()); } else { addIntoListbox(currDateTime.ToString()); } }