如果我有一个类,Car
并且我调用了几个实例,例如一个吉普车。我将如何将我已经创建的图像资源绑定到这个实例?
public class Car
{
public string Name;
public string Color;
public int Value;
}
Car Jeep = new Car();
Jeep.Name = "Jeep";
Jeep.Color = "Red";
Jeep.Value = 20000;
//Jeep.image = jeep; <--- Something like this is possible?
例如:
Image jeep = WindowsFormsApplication1.Resource1.image1;
我希望能够说类似的话,
pictureBox1.Image = List[0].image;
因为我会将 Jeep、Camaro、Mustang 等列入清单。
有人指出我正确的方向吗?