Ok I'm trying to derive from the picturebox control in System.Windows.Forms and set it to a default pic that can be changed via a setPic method.
It's supposed to be a blank box that changes to a red x when the user gets a question wrong...
public class xBox : System.Windows.Forms.PictureBox
const byte a = 20;
this.Size = new Size(a, a);
public void setPic(bool correct)
this.SizeMode = PictureBoxSizeMode.Normal;
path = @BlankX.BMP
path = @RedX.BMP
this.Image = Image.FromFile(path);
Every time I try to add the control to the form, I get a FileNotFoundException. It can't load the blankX.bmp file, which is in the same directory as the project, right clicked and selected "include in project" and everything. I have tried using various iterations of the file name... "~/BlankX.bmp" , @~/BlankX.bmp
etc etc and nothing seems to work.
I can only assume there's some property of PictureBox that I'm unaware of that I need to set? nothing that I can figure out.