Hi, this is my first question, I've been looking for a solution for 2 days and nothing.
Im creating a custom control that uses a picturebox and im trying to select the image from the property grid... but I get this error:
Error 2 The type or namespace name 'ImageEditor' does not exist in the namespace 'System.Drawing.Design' (are you missing an assembly reference?) C:\Users\Personal\...\ImageButton.cs 33 51 My Project
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Design;
namespace MyNamespace
{
public partial class ImageButton : UserControl
{
public ImageButton()
{
InitializeComponent();
}
private Image normal;
public string TestString
{
set;
get;
}
[EditorAttribute(typeof(System.Drawing.Design.ImageEditor),typeof(System.Drawing.Design.UITypeEditor))]
public Image ImageNormal
{
set
{
normal = value;
}
get
{
return normal;
}
}
}
}
I've tried using differents versions of .net framework 2.0, 3.5, 4 and the same problem, also i've tried to use VS2010 Express Edition and Professional on different PCs and im getting the same problem...
I can assign the Image property programmatically, but when I show the form on the designer, I get another error, saying that the custom control class does not have a property called ImageNormal... but it does..
when I browse the namespace System.Drawing.Design I cannot see all the classes that it should have (according to
http://msdn.microsoft.com/en-us/library/ks225801[
^]), only
CategoryNameCollection
PaintValueEventArgs
PropertyValueUIItem
ToolboxComponentsCreatedEventArgs
ToolboxComponentsCreatingEventArgs
ToolboxItem
ToolboxItemCollection
UITypeEditor
all the Prebuilt UITypeEditors classes are missing! (BitmapEditor, ColorEditor, ContentAlignmentEditor, CursorEditor, FontEditor, FontNameEditor, IconEditor,
ImageEditor, MetafileEditor)
so I wonder why is this happenig to me, I supose im doing something wrong... the APP is a Windows Forms Application.
Any help will be appreciated.
PS: Excuse me if there is anything wrong/weird with my English.