C# UserControl从C中的资源获取图像#
我想让用户控制与自由改变图像。我搜索并制作了以下代码C# UserControl从C中的资源获取图像#,c#,image,user-controls,C#,Image,User Controls,我想让用户控制与自由改变图像。我搜索并制作了以下代码 [Description("Setting the image which shows main"), Category("Custom"), DefaultValue(typeof(Image),"null"), EditorAttribute(typeof(System.Drawing.Design.ImageEditor), typeof(System.Drawing.Design.UITypeEditor))] publi
[Description("Setting the image which shows main"), Category("Custom"),
DefaultValue(typeof(Image),"null"),
EditorAttribute(typeof(System.Drawing.Design.ImageEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public Image MainImage
{
get { return pictureBoxMain.Image; }
set { pictureBoxMain.Image = value; }
}
当我尝试在design editor上更改图像时,它调用exploror。但我想显示的不是exploror,即主项目的资源列表。(只需调用基本图像属性)
我想也许我应该在底线下换衣服
EditorAttribute(typeof(System.Drawing.Design.ImageEditor),
typeof(System.Drawing.Design.UITypeEditor))]
在这里结巴。所以请帮我解决这些问题。我已经尝试了
[Description(“设置显示main的图像”)、Category(“Custom”)、DefaultValue(typeof(image),“null”)]public image main image{get{return pictureBoxMain.image;}set{pictureBoxMain.image=value;}
我对此没有任何问题。rraszewski///谢谢。完成。