Home c# How to upload in Windows Forms PictureBox form?

How to upload in Windows Forms PictureBox form?

Author

Date

Category

I have a folder in which images are stored. I need to be necessary if the condition is executed, the program displayed one of these images into the PictureBox form. How to do this? (C #)


Answer 1, Authority 100%

If the condition is correct, we are looking for files from the folder (read it ) and load the selected in PictureBox (read is and To )


Answer 2, Authority 100%

if (/ * your condition * /)
    {
      System.io.Filestream FS = new System.io.Filestream (@ "path to file", System.io.Filemode.open);
      System.Drawing.Image img = system.drawing.image.FromStream (FS);
      FS.Close ();
      PictureBox1.image = img;
    }

Answer 3

so better

picturebox.image = properties.resources. Cartinka;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions