如何制作属性图片使用清单
问题描述:
大家好.
我尝试制作一个属性图像,例如代码:
Hi all.
I try to make a properties Image such as code:
List<Image> _List=new List<Image>();
Public List<Image> List
{
get
{
return _List;
}
set
{
_List=value;
}
}
但是似乎不起作用.
你能帮我吗?
谢谢!
But seem it not work.
can you help me?
Thanks!
答
您的示例显示的是图像列表,而不是图像.要制作图像属性,只需编写
your example shows a List of Images, not an Image. To make an Image Property just write
public Image myImage {get; set;}
efkah是正确的.
在这里列出(实际上它是这样对待的:
List< class>在这里上课吧.)
为此,您可以为必填字段设置Image属性类(在这种情况下,还可以设置Image).
所以这样做:
efkah is right.
Here List (actually it treates like this :
List<class> here class what ever it may be.)
for that you can set a Image property class for your required field(in you r case also Image ).
so do like this:
List<MyImage> _List=new List<MyImage>();
Public Image MyImage
{
get;
set;
}