How Do You Resolve This Parameter Not Valid Error? (C#, VisualStudio, WinForms)

孤街浪徒 提交于 2020-07-23 06:14:49

问题


Apologies for being such an amateur, but this error pops up for every picture box every time I run the program. I tried re-importing the images and even deleting the pictureboxes, but the error always finds another picture box to work on (like it's intelligent or something).

What is the problem here and how do you fix this?


回答1:


You can add an image to a picture box as an embedded resource like that:

  1. Put a PictureBox on the WinForm.
  2. Select the quick action "Add image" or the "..." of the Image property.
  3. Select "Project resource file" and import.

Delete the picture box and the embeded resource image in case of problem then retry, or do it with an empty project to see if it works fine with your VS.

Also try another image and/or check if your image has a good format or if it has an esoteric content: convert it to another format or save it again (with XnView, Gimp, Photoshop... for example).



来源:https://stackoverflow.com/questions/62730593/how-do-you-resolve-this-parameter-not-valid-error-c-visualstudio-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!