5
Answers

Background Image Resource Name

Jay Webster

Jay Webster

13y
4k
1
I am trying to find out if the background image in a set of pictureboxes is the same as any of my image resources. The following always returns "None" for all the pictureboxes although they all have the background image player.

foreach (Control ctrl in this.radGroupBox1.Controls)
{
 ctrl.BackgroundImage = Resources.player;

 if ((Image)ctrl.BackgroundImage == (Image)Resources.blank)
         Console.WriteLine("Blank");
 else if ((Image)ctrl.BackgroundImage == (Image)Resources.player)
         Console.WriteLine("Player");
 else 
         Console.WriteLine("None");
}

Not sure why :(

Answers (5)