private void btRemove_Click(object sender, EventArgs e) { if (lstArquivos.SelectedIndex >= 0) { if (MessageBox.Show("Do you really want to remove this item?", "Remove Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { SelectedFiles.RemoveAt(lstArquivos.SelectedIndex); LoadListOfFiles(); } } }
private void btnRemove_Click(object sender, EventArgs e) { if (listResources.SelectedIndex < 0) { return; } if (MessageBox.Show(@"Do you really want to remove this item?", @"Remove Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes) { return; } _selectedFiles.RemoveAt(listResources.SelectedIndex); LoadListOfFiles(); }