Click here to Skip to main content
14,358,929 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
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()

    private Image normal;

    public string TestString // Just for test if the property is displayed in the property box -and it does -

    // Im getting the error in the next line.. 
[EditorAttribute(typeof(System.Drawing.Design.ImageEditor),typeof(System.Drawing.Design.UITypeEditor))] // According to
    public Image ImageNormal
        normal = value;
         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[^]), only

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.
Rate this:
Please Sign up or sign in to vote.

Solution 1

For the namespace to get recognised you should add it's dll as a reference.

You should add the System.Drawing.Design dll as reference.
Rate this:
Please Sign up or sign in to vote.

Solution 2

Thanks for the help.. when I realized that System.Drawing.Design was not on the reference list

I found the solution by:

1) My project target was ".NET FW 4.0 Client Profile". Changed to ".NET FW 4.0" (System.Drawing.Design is not available for client profiles!!)
2) Project restarted..
3) Deleted Previous Reference of System.Drawing
4) Added reference to System.Drawing and System.Drawing.Design(after switching to .NET FW 4.0 it appeared on the reference list.)
5) Problem solved.

thanks Rajeev Jayaram.
Rajeev Jayaram 28-Jun-12 15:52pm
You're welcome.

Note: If you mean to add comments to any solution you should use the "Have a Question or Comment?" option.
sal0m0n 28-Jun-12 16:45pm
Thanks again.

[no name] 17-Dec-15 9:46am
want the solution for my problem
Dave Kreskowiak 17-Dec-15 10:10am
Sorry, we can't prescribe medication.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100