Weird problem with Button.Image
-
I have a Button (btnGet) on a UserControl which I am setting Image property of to a GIF. The problem : It does show in design time but doesnt on runtime. (The UserControl has few other buttons which has their image property set to other images and working fine. However if I change their images to other, it doesnt work.) Investigation : I checked the .resx file and it contains the image data in the "btnGet.Image" element. Put breakpoint in the InitializeComponents() where it assigns the image to button.
this.btnGet.Image = ((System.Drawing.Image)(resources.GetObject("btnGet.Image")));
resources.GetObject("btnGet.Image")
returns null. I tried this after deleting all the intermediate files like .pdb, .obj When I set the image to a Button in other form in the same project (as well as in other). Works perfect!:mad: Solution : What could it be?:confused: Every bit counts -
I have a Button (btnGet) on a UserControl which I am setting Image property of to a GIF. The problem : It does show in design time but doesnt on runtime. (The UserControl has few other buttons which has their image property set to other images and working fine. However if I change their images to other, it doesnt work.) Investigation : I checked the .resx file and it contains the image data in the "btnGet.Image" element. Put breakpoint in the InitializeComponents() where it assigns the image to button.
this.btnGet.Image = ((System.Drawing.Image)(resources.GetObject("btnGet.Image")));
resources.GetObject("btnGet.Image")
returns null. I tried this after deleting all the intermediate files like .pdb, .obj When I set the image to a Button in other form in the same project (as well as in other). Works perfect!:mad: Solution : What could it be?:confused: Every bit counts -
I have a Button (btnGet) on a UserControl which I am setting Image property of to a GIF. The problem : It does show in design time but doesnt on runtime. (The UserControl has few other buttons which has their image property set to other images and working fine. However if I change their images to other, it doesnt work.) Investigation : I checked the .resx file and it contains the image data in the "btnGet.Image" element. Put breakpoint in the InitializeComponents() where it assigns the image to button.
this.btnGet.Image = ((System.Drawing.Image)(resources.GetObject("btnGet.Image")));
resources.GetObject("btnGet.Image")
returns null. I tried this after deleting all the intermediate files like .pdb, .obj When I set the image to a Button in other form in the same project (as well as in other). Works perfect!:mad: Solution : What could it be?:confused: Every bit counts