private void buttonDelete_Click(object sender, EventArgs e) { ConfirmBox cb = new ConfirmBox("Delete this image?"); DialogResult dialogResult = cb.ShowDialog(); if (dialogResult == DialogResult.Yes) { pictureBox1.Image.Dispose(); File.Delete(sm.Images[currentImage].LocalPath); sm.Images.RemoveAt(currentImage); ChangeImage(currentImage); sm.WriteSettingsFile(); } }
private void buttonDelete_Click(object sender, EventArgs e) { ConfirmBox cb = new ConfirmBox("Delete this image?"); DialogResult dialogResult = cb.ShowDialog(); if(dialogResult == DialogResult.Yes) { pictureBox1.Image.Dispose(); File.Delete(sm.Images[currentImage].LocalPath); sm.Images.RemoveAt(currentImage); ChangeImage(currentImage); sm.WriteSettingsFile(); } }