Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Personalize the Visual Studio IDE.
Private myUserControl1 As MyUserControl
Private myCustomTaskPane As Microsoft.Office.Tools.CustomTaskPane
Add the following code to the ThisAddIn_Startup event handler. This code creates a new CustomTaskPane by adding the MyUserControl object to the CustomTaskPanes collection. The code also displays the task pane.
myUserControl1 = new MyUserControl();
myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1, "My Task Pane");
myCustomTaskPane.Visible = true;
myUserControl1 = New MyUserControl
myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "My Task Pane")
myCustomTaskPane.Visible = True
Note
This code associates your custom task pane with the active window in the application. For some applications, you might want to modify this code to ensure that the task pane appears with other documents or items in the application. For more information, see Custom task panes.