I have a form with OpenFileDialog for selecting image and showing it in pictureBox. Until the form is open the user can open and then save the opened image as many times as he wants.But when he secont time open openfiledialog the picture show but the both image show in same location,
I want the picture not show in same location,Please tell me the location of image.

 private void button1_Click(object sender, EventArgs e)
        {
            PictureBox pic = new PictureBox();
            {
                try{
  OpenFileDialog open = new OpenFileDialog();
  open.Title = "OPen Image";
   // open.Filter = "PNG image (*.png)|*.png|Jpg image (*.jpg)|*.jpg|";
  open.Filter = "JPG Files (*.jpg)|*.jpg|JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|GIF Files (*.gif)|*.gif";
    DialogResult result = open.ShowDialog();
     if (result == DialogResult.OK)
      {

     pic.Image = new Bitmap(open.FileName);
        pic.SizeMode = PictureBoxSizeMode.AutoSize;
     listView1.Controls.Add(pic);
   }   
     }
     catch (Exception ex)
 {
   // Could not load the image - probably related to Windows file system permissions.
    MessageBox.Show("Cannot display the image: " + ex.Message);
           }
     }
    }

What is listView1?
A PictureBox has a Location property. Perhaps you should have more PictureBoxes?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.