How to: Add a Custom Task Pane to an Application
| Note | Required applications |
|---|---|
|
The features in this topic are available only if you have the required applications installed. For more information, see Features Available by Product Combination. |
|
You can add a custom task pane to some applications in the 2007 Microsoft Office system by using an application-level add-in. For more information, see Custom Task Panes Overview.
Note |
|---|
|
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, select Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings. |
Adding a Custom Task Pane to an Application
To add a custom task pane to an application
-
Open or create an application-level project for an application in the 2007 Microsoft Office system. For more information, see How to: Create Visual Studio Tools for Office Projects.
Note Microsoft Office Visio 2007 does not support custom task panes. For more information, see Custom Task Panes Overview.
-
On the Project menu, click Add User Control.
-
In the Add New Item dialog box, change the name of the new user control to MyUserControl, and click Add.
The user control opens in the designer.
-
Drag one or more Windows Forms controls from the Toolbox to the user control.
-
Open the ThisAddIn.cs or ThisAddIn.vb code file.
-
Add the following code to the
ThisAddInclass. This code declares an instance ofMyUserControlas a member ofThisAddIn. -
Add the following code to the
ThisAddIn_Startupevent handler. This code adds theMyUserControlobject to theCustomTaskPanescollection and displays the custom task pane.