pro*_*ach 5 c# exception-handling image .net-2.0 winforms
我在许多计算机上运行.NET 2.0程序.在一个我有重复发生此错误,直到我重置应用程序.
//line below was throwing the exception
this.myButton.BackgroundImage = global::myNamespace.Properties.Resources.myImage;
Run Code Online (Sandbox Code Playgroud)
例外:
ExceptionType: ArgumentException
Message: Parameter is not valid.
Source: System.Drawing
StackTrace: at System.Drawing.Image.get_Flags()
at System.Windows.Forms.ControlPaint.IsImageTransparent(Image backgroundImage)
at System.Windows.Forms.Control.set_BackgroundImageLayout(ImageLayout value)
Run Code Online (Sandbox Code Playgroud)
资源存在,重置后工作正常.任何人都可以提供任何有关可能发生的见解吗?