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
Post a Comment