How to do this? You don’t have to override OnResize and do those checks (DesignMode, IsHandleCreated, etc.). I’ve been here and I’ve encountered a number of problems. A better way is to create a designer class, attach a handler on the Resize event of the component being designed (your control). Ideal...
The CollectionCodeDomSerializer uses reflection to serialize a serializeable collection properties to locate methodinfo with “Add” and “AddRange” as names. We have a coding convention here to use prefix to clearly distinguish methods from properties, and others. Method like these should have been exempted...
The virtual readonly SelectionRules property of the ControlDesigner class is necessary if you want to fiddle with the selection grabs of your control at designtime (if you want to make your control not re-sizable vertically like the Windows Forms TextBox control). You might experience a control design...
Some control properties where dropped. Forms still have them in InitializeComponent. Form is loaded at designtime with an attached debugger instance (devenv.exe). CodeDomSerializer class tries to deserialize the said property set. A MissingMethodException was raised. Attached debugger could not give...
I have blogged about the Windows Forms designer behavior with abstract base forms here . Brian Pepin has an update on how Whidbey can support design-able abstract classes through the new TypeDescriptionProvider class. He also points out an important example of the power of attribute-based programming...
It is interesting to know how the Designers works in Visual Studio when one is designing a component, control or form (controls and forms by the way are special kind of components with visual representation at the document surface). Knowing such kind of information can be crucial for a Windows Form Developer...