private void DeleteBtn_Click(object sender, EventArgs e) { if (SyncList.SelectedItem == null) { LogLine("Nothing selected to delete."); return; } SyncList.Items.Remove(SyncList.SelectedItem); if (SyncList.SelectedItem == null) { AddBtn.Focus(); // avoid default focus on "Sync All" button } }