An unhandled exception of type 'System.InvalidCastException' occurred in Yatzy.exe
Additional information: Specified cast is not valid.
syftar på raden:
this.pictureBox1.Image = ((System.Drawing.Imaging.Metafile)(resources.GetObject("pictureBox1.Image")));
som är autogenererad i Microsoft Visual Studio .NET
bilden är i .wmf format.
Alltså... jag ersatte castingen (System.Drawing.Imaging.Metafile) med (Image) och då fungerade det....
Men förlorar jag något på att göra så? Och varför genereras inte kod som fungerar ? ;)