Take the 2-minute tour ×

currently i am loading a image from button.But now i have to drag a image from folder to the picture box at run time.How can we implement this?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

ok.The below code is working fine.

 private void pictureBox1_DragEnter(object sender, DragEventArgs e)

            pictureBox1.Image = null;
            string[] filename = (string[])e.Data.GetData(DataFormats.FileDrop);
            pictureBox1.Image = Image.FromFile(filename[0]);
        catch (Exception expr)
        { }
share|improve this answer

Your Answer


