none
OpenDialogBox to a PictureBox RRS feed

  • Question

  • I'm trying to show in a PictureBox an image (.jpg) selected from the OpenDialogBox.  I tried:

    PictureBox1.Image = OpenFileDialog1.ShowDialog(), but this shows as an error that it can not be converted to System.Drawing.image       

    Help!


    Martin R Pettersson

    Sunday, March 22, 2020 7:43 PM

All replies

  • Hi Martin,
    try this:

        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
          PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
        End If


    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Sunday, March 22, 2020 8:19 PM
  • Hi,

    Have you solved this problem now?

    I think the above reply can provide you with a solution, have you tried it?

    If so, hope you can close this thread by marking the reply as answer as this will help others looking for the same or similar issues down the road.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 26, 2020 2:47 AM
    Moderator