Load Image using C# -


i open image tried methode when click on button window doesn't appear cant load image

    private void button1_click(object sender, eventargs e)     {         openfiledialog open = new openfiledialog();         if (open.showdialog() == dialogresult.ok)         {              picturebox1.imagelocation = open.filename;             } 

there "open" , "cancel" buttons on openfiledialog. because there no "ok" button on it, "if condition" not true. should change to:

private void button1_click(object sender, eventargs e)     {         openfiledialog open = new openfiledialog();         if (open.showdialog() != dialogresult.cancel)         {              picturebox1.imagelocation = open.filename;             }     } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -