Skip to Content
.NET Windows® Forms Custom Controls
book

.NET Windows® Forms Custom Controls

by Richard Weeks
January 2002
Intermediate to advanced
288 pages
5h 48m
English
Sams
Content preview from .NET Windows® Forms Custom Controls

DesignerAttribute

To specify the designer for a control, the System.ComponentMode.Design.DesignerAttribute is used to decorate the control class. The word decorate is used to denote the fact that the DesignerAttribute provides extra information about the control class. The control class itself does not use the specified designer class; however, VS .NET uses this information to locate and create the specified designer. In the case of the IconButton, the DesignerAttribute would be declared as shown here:

1: [
2: System.ComponentModel.Design.Designer (
3:                 typeof( SAMS.ToolKit.Design.IconButtonDesigner )
4:                                        )
5: ]
6: public class IconButton : ... {  //rest of class }

The declaration for the designer assumes that the IconButtonDesigner resides in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types

Pro .NET 5 Custom Libraries: Implementing Custom .NET Data Types

Roger Villela
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 0672323338Purchase book