private void OnStudentLabelClick(object sender, EventArgs e) { Label lbl = (Label)sender; Student student = this.labelStudentLinker[lbl]; DialogResult dialog = MessageBox.Show("Are you sure you want to remove '" + student.forename + "' from '" + group.name + "'?", "Remove confirmation", MessageBoxButtons.YesNo); if (dialog != DialogResult.Yes) { return; } APIHandler.RemoveStudentFromGroup(student, this.group); groupStudents.Remove(student); allNonGroupStudents.Add(student); }