Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access System.Windows.Forms.Design.ParentControlDesigner?

Altough this seems like a stupid question, VS2010 tells mit, that System.Windows.Forms.Design contains only 9 classes, whereas MSDN list 20+.

All I want, is to write the following class(http://msdn.microsoft.com/en-us/library/ms973820.aspx):

public class DragDropControlDesigner : ControlDesigner {
      public override void Initialize(IComponent c) {
         base.Initialize(c);
         ((Control)c).AllowDrop = false;
      }
   }

Project references and user directives don't help. I am even actively using the class with

[Designer("System.Windows.Forms.Design.ParentControlDesigner, 
 System.Design", 
 typeof(IDesigner))]

on one of my user controls. I searched for tutorials and on forums for an answer: nothing. Is there someone out there, who has written a custom designer and can tell me how to solve this?

like image 299
Thomas Avatar asked Jan 08 '12 05:01

Thomas


1 Answers

I know i'm very late, but as the second parameter of the DesignerAttribute indicates, this class is in the System.Design assembly. If you add a reference to System.Design, you should see the class.

like image 186
echo Avatar answered Oct 21 '22 12:10

echo