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
| private void Form3_Load(object sender, EventArgs e)
{
pictureBoxCadre.AllowDrop = true;
}
private void toolStripButtons4_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
toolStripButton4.DoDragDrop(toolStripButton4.Image,DragDropEffects.All);
}
private void pictureBoxCadre_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Bitmap))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void pictureBoxCadre_DragDrop(object sender, DragEventArgs e)
{
if ((e.Data.GetDataPresent(DataFormats.Bitmap)))
this.pictureBoxCadre.Image = (Bitmap)(e.Data.GetData(DataFormats.Bitmap));
} |