日期:2014-05-18 浏览次数:21138 次
string imageName; public string ImageName { get { return imageName; } set { imageName = value; //this.BackgroundImage = Properties.Resources._0; switch (ImageName)//这样的是不可取的 因为图片要是有很多的话,一点不好。 { case "_0": this.BackgroundImage = Properties.Resources._0; break; case "_1": this.BackgroundImage = Properties.Resources._1; break; default: break; } } }
string imageName; public string ImageName { get { return imageName; } set { imageName = value; this.BackgroundImage = Properties.Resources.ResourceManager.GetObject(value) as Image; } }