Jay Webster

Jay Webster

  • NA
  • 67
  • 0

Background Image Resource Name

Mar 14 2011 7:10 PM
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)