f you have used Visual Studio 2005, chances are you've noticed the new Smart Tag feature. Basically, a Smart Tag is a panel that is displayed next to a control, containing a list of commonly used properties. By saving you a trip to the Properties window for some of the more common properties you need to set, Smart Tag can improve development productivity.
Figure 1 shows the ListView control with its Smart Tag panel displayed. You display the Smart Tag by clicking on the small arrow icon known as the anchor.
The Smart Tag contains a list of actions or properties (such as View). Actions are items such as Edit Items, which will bring up another window for you to edit the items in the ListView control.
Most controls (be they Windows or Web Server controls) support Smart Tag. While use of Smart Tag is a great way to increase productivity, if you are a custom control developer Smart Tag can also serve you well. You can allow the users of your controls to utilize the Smart Tag feature of Visual Studio 2005.
In this article I will show you how you can add Smart Tag support to your custom control. For simplicity, I will create a custom Button control based on the standard Button control. Figure 2 shows the Smart Tag that you will create in this article.
Figure 1. Smart Tag Example: The screen shot shows the ListView control with its Smart Tag displayed.
Figure 2. Today's Project: The screen shot shows the finished Smart Tag for a custom control.
Before you start building a custom control and its corresponding Smart Tag, it is useful to define some terms pertinent to Smart Tags (see Figure 3
). Each item in the Smart Tag is known as the Designer Action Item
. You can organize the various designer action items into categories known as Designer Action Headers
. The list of items and headers in the Smart Tag is known as the Designer Action List