private void btnRemoveUser_Click(object sender, EventArgs e) { if (lstUsers.SelectedIndices.Count == 0) { MessageBox.Show("You must select a user to delete.", "No user selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult result = MessageBox.Show("Are you sure that you would like to remove this user?", "Confirm - DROP USER" , MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.No || result == DialogResult.Cancel) { return; } BusinessObjects _businessObjects = new BusinessObjects(); int returnValue = _businessObjects.DeleteUserAccount(lstUsers.SelectedItems[0].Text); if (returnValue == 0) { MessageBox.Show("User deleted successfully.", "Result" , MessageBoxButtons.OK, MessageBoxIcon.Information); } RefreshUserList(); }