This documentation is archived and is not being maintained.

CustomTaskPane.Visible Property

Gets or sets a value that specifies whether the custom task pane is visible.

Namespace: Microsoft.Office.Tools
Assembly: Microsoft.Office.Tools.Common2007 (in

public bool Visible { get; set; }

Property Value

true if the custom task pane is visible; otherwise, false. The default is false.

Exception typeCondition


The Dispose method of the CustomTaskPane has already been called.

The following code example creates a custom task pane and displays it. This code example is part of a larger example provided for the CustomTaskPane class.

private MyUserControl myUserControl1;
private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;

private void ThisAddIn_Startup(object sender, System.EventArgs e)
    myUserControl1 = new MyUserControl();
    myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1, 
        "New Task Pane");

    myCustomTaskPane.DockPosition =
    myCustomTaskPane.Height = 500;
    myCustomTaskPane.Width = 500;
    myCustomTaskPane.DockPositionRestrict =
    myCustomTaskPane.Visible = true;

    myCustomTaskPane.VisibleChanged += 
        new EventHandler(myCustomTaskPane_VisibleChanged);
    myCustomTaskPane.DockPositionChanged += 
        new EventHandler(myCustomTaskPane_DockPositionChanged);