WinForms - Can't add picture to picturebox


I pretty much just started using Windows forms and I'm trying to add a picture to a picture box. First I tried the most obvious way, that is - clicking on the little arrow in the top right corner of a picturebox and clicking "choose image" in the small dialog box, but no matter what I do, the "choose image" button does utterly nothing. I know it should open some dialog box where I could choose my picture, but litterally nothing happens, not even an error message pops up.

Next I tried importing the picture through the properties of the picturebox, but after clicking on the three dots next to the image property an error message pops up, saying "value cannot be NULL, Name o parameter: docData".

I tried following this answer (How to attach a resource (an image for example) with the exe file?) and going to the properties of my project and then to the resources tab, but I have this tab completely empty, saying just that my project does not contain any default resources and a "click to create them" button. However when I click it, another error message appears saying "system cannot find the file. Exception based on value HRESULT:0x80070002"

I guess the problem must be somewhere in my resources file (which might be missing or whatever), but I have a default .resx file there that I haven't touched since the creation of this project which I had thought should be fine.

Afterall I pretty much just started with WinForms and I don't have much clue what's going on and this is quite a significant setback for me. I would be grateful for any help.

asked on Stack Overflow Oct 28, 2020 by Vit Zelezny

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0