Skip to content
Loading
  • bishoe nb
    0
    I deleted openFileDialog1
    And re-add them
    But the following error appeared
    System.IO.File.Copy(openFileDialog1.FileName, fName);Additional information: Could not find file 'openFileDialog1'.
     
     
    You added the code here
    private void PicImage_Regisrt_Click(object sender, EventArgs e)
    {

    //image Register
    //openFileDialog1.Title = "Insert an image ";
    //openFileDialog1.InitialDirectory = "C:\\Users\bishoe\\Downloads";
    //openFileDialog1.FileName = "";
    //openFileDialog1.Filter = "JPEG Image|*.jpg|GIF Image|*.gif|PNG Image|*.png";
    //openFileDialog1.Multiselect = false;
    //if (openFileDialog1.ShowDialog() != DialogResult.OK)
    // return;

    //display image in pic box

    //PicImage_Regisrt.ImageLocation =
    //openFileDialog1.FileName;
    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {
    if (openFileDialog1.FileName != null && openFileDialog1.FileName != "")
    {
    PicImage_Regisrt.ImageLocation =
    openFileDialog1.FileName;
    }
    } 
     not working
    0
  • Mageshwaran R
    0
    Hi,
    Can you check with the below link:
    https://www.c-sharpcorner.com/UploadFile/mahesh/openfiledialog-in-C-Sharp/ 
    0