1
Reply

Get Picturebox File Name

Ask a question
Ye Htut

Ye Htut

10y
4.5k
1
public class photo

picture pbx =new picturebox();


private voide btnok(object sender, EventArgs e)
    {
    string[] files=System.IO.Directory.GetFiles(@"D:\Building_Case");

    for each(string file in files)
    {
     pbx.image=image.fromfile(file);
     }
pbx.DoubleClick+=pbx_DoubleClick;
     }

   void pbx_Double_Click(object sender, EventArgs e)
        {          
            string path=pbx.imagelocation;
            messagebox.show(path);

         
        } 
}
// path string always return null. so I don't know how to get picturebox file path to open with Windows Photo Viewer
plz help me. I am urgent

Answers (1)
Next Recommended Forum