1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
public void Delete(PictureBox picture)
{
picture.Image = null;
File.Delete(filepath + "\\picture0.bmp");
}
private void btnSupp_Click(object sender, EventArgs e)
{
if (radioButton3.Checked)
{
Delete(picture1);
MessageBox.Show("Image supprimée");
radioButton3.Visible = false;
this.Invalidate();
}
else if (radioButton4.Checked)
{
Delete(picture2);
MessageBox.Show("Image supprimée");
radioButton4.Visible = false;
this.Invalidate();
}
else if (radioButton2.Checked)
{
Delete(picture3);
MessageBox.Show("Image supprimée");
radioButton2.Visible = false;
this.Invalidate();
}
else if (radioButton1.Checked)
{
Delete(picture4);
MessageBox.Show("Image supprimée");
radioButton1.Visible = false;
this.Invalidate();
}
} |
Partager