Walkthrough: Performing Common Tasks Using Smart Tags on Windows Forms Controls
As you construct forms and controls for your Windows Forms application, there are many tasks you will perform repeatedly. These are some of the commonly performed tasks you will encounter:
Adding or removing a tab on a TabControl.
Docking a control to its parent.
Changing the orientation of a SplitContainer control.
To speed development, many controls offer smart tags, which are context-sensitive menus that allow you to perform common tasks like these in a single gesture at design time. These tasks are called smart-tag verbs.
Smart tags remain attached to a control instance for its lifetime in the designer and are always available.
Tasks illustrated in this walkthrough include:
Creating a Windows Forms project
Using smart tags
Enabling and Disabling Smart Tags
When you are finished, you will have an understanding of the role played by these important layout features.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Customizing Development Settings in Visual Studio.
Creating the Project
The first step is to create the project and set up the form.
To create the project
Create a Windows-based application project called "SmartTagsExample". For details, see How to: Create a Windows Application Project.
Select the form in the Windows Forms Designer.
Using Smart Tags
Smart tags are always available at design time on controls that offer them.
To use smart tags
Click the smart-tag glyph. In the shortcut menu that appears next to the glyph, select the Add Tab item. Observe that a new tab page is added to the TabControl.
Drag a TableLayoutPanel control from the Toolbox onto your form.
Click the smart-tag glyph. In the shortcut menu that appears next to the glyph, select the Add Column item. Observe that a new column is added to the TableLayoutPanel control.
Drag a SplitContainer control from the Toolbox onto your form.
Click the smart-tag glyph. In the shortcut menu that appears next to the glyph, select the Horizontal splitter orientation item. Observe that the SplitContainer control's splitter bar is now oriented horizontally.