How to upload an image on windows form Application C#

25
3



In this tutorial we’ll learn about how we can insert/upload an image on Windows Form Application C#.

++++++++++++++++++++++++++++++++++++++++++++
Follow Me on Linkedin:

Follow us on Google Plus:

++++++++++++++++++++++++++++++++++++++++++++

if You Have any Query, feel free to contact Us on Facebook:

++++++++++++++++++++++++++++++++++++++++++++

Please Don’t forget to Subscribe for More Videos. 🙂 🙂

Nguồn:https://wijstaanvooronzegrondrechten.org/

25 COMMENTS

  1. private void bt_upload_Click(object sender, EventArgs e)

    {

    try

    {

    // code

    OpenFileDialog dialog = new OpenFileDialog();

    dialog.Filter = "jpg files(.*jpg)|*.jpg| PNG files(.*png)|*.png| All Files(*.*)|*.*";

    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

    {

    imagelocation = dialog.FileName;

    img_ex.ImageLocation = imagelocation;

    }

    }

    catch (Exception )

    {

    MessageBox.Show("An error occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

    }

    }

  2. I'm confused by this video… you just opened the picture and displayed it in the app… the video description is wrong because you haven't uploaded it to anywhere. Maybe change the title of the video to: "How to open / display an image on windows form Application C#" Thanks 🙂

  3. The code is great, the one mistake here is that the filter string have a validation error. You can try this to sort this out…

    "jpg files(.*jpg)|*.jpg| PNG files(.*png)|*.png| All Files(*.*)|*.*"

LEAVE A REPLY

Please enter your comment!
Please enter your name here