Category: Uncategorized
-
Custom Controls Design Time Support Part 11: Designer Verbs
This post is simple and neat, the goal now is to add some designer verbs, so lets get straight. What is a Designer Verb? A designer can use the DesignerVerb class to add menu commands to the shortcut menu for the component it provides designer support for in design mode. Designer verbs associate a menu…
-
Custom Controls Design Time Support Part 10: Filtering Control Members
As I mentioned in introducing the Designer post that one of the designer powers is filtering the control members, filtering here means removing or adding members (Properties, Events or Attributes) to the DesignTime Environment in the PropertyWindow. The IDesignerFilter interface has the methods that enable filtering the members that appear in the Design time PropertyWindow. The…
-
Custom Controls Design Time Support Part 9: Introducing the Designer
What is a Designer? Designers are objects that have the ability to modify a component’s design time behavior on a design surface. A designer can display a component’s user interface as well as allow property changes to the component. It can also provide other services and perform additional processing specific to the component it is…
-
Custom Controls Design Time Support Part 8: Implementing UITypeEditor
In the previous post I gave a brief introduction on what is a UITypeEditor and what you can get from using it, this part I will show you how to implement one. So here are the steps: Define a class that derives from System.Drawing.Design.UITypeEditor. Override GetEditStyle to return a supported UITypeEditorEditStyle. Override EditValue and pass…
-
Custom Controls Design Time Support Part 7: UITypeEditor Introduction
In the previous posts in this series I introduced how to use some basic and advanced Attributes and how to add an image for your control to appear in the toolbox and then I gave an introduction on TypeConverters and examples here and here on how to use the TypeConverters. Now I will give an introduction…
-
Custom Controls Design Time Support Part 6: Custom TypeConverter 2
The last post in the series I have showed you how to implement a custom TypeConverter and override some of the virtual methods from the base class. In this post I'll show how to some more advanced examples on how to get the most of TypeConverters. First look at the strucure of the example. [more] …
-
Custom Controls Design Time Support Part 5: Custom TypeConverters
In the previous post I gave an introduction on common TypeConverters and how to use them, in this post I will show you how to implement custom TypeConverters for your own custom data types. First, lets explore the TypeConverter base type virtual methods … Method Description CanConvertFrom Returns a Boolean value indicating whether the converter…
-
Custom Controls Design Time Support Part 4: TypeConverters Introduction
I mentioned in my Introduction post of this series the TypeConverters Overview: For those who don't know what is a TypeConverter you can expect that it is something responsible to convert between types, there are times when you need to convert from one data type to another. Type converters are classes that describe how a…
-
Custom Controls Design Time Support Part 3: Adding Image in the Toolbox
Attributes Applied To Description ToolboxBitmap Controls Allows you to specify an icon to represent a control in a container, such as the Microsoft Visual Studio Form Designer. » ToolboxBitmapAttribute if you want to redistribute your custom control you should use this attribute to add an icon to it. [code:c#] [ToolboxBitmap(typeof(Button))] public class ButtonEx : Button…
-
Custom Controls Design Time Support Part 2: More Design Time Attributes
In my previous post I pointed out the most common used Attributes for Design Time Support. In this part I will point out some more Attributes that take advantage of the Design Time Environment. Attributes Applied To Description DisplayName Properties & Events Specifies the display name for a property or an event. ParenthesizeProperty Properties Indicates whether the…