CustomTaskPane::DockPosition Property
Gets or sets a value that specifies where the custom task pane is located relative to the application window.
Assembly: Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)
property MsoCTPDockPosition DockPosition { MsoCTPDockPosition get(); void set(MsoCTPDockPosition value); }
Property Value
Type: Microsoft.Office.Core::MsoCTPDockPositionOne of the Microsoft.Office.Core.MsoCTPDockPosition values. The default is Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight.
| Exception | Condition |
|---|---|
| ObjectDisposedException | The M:Microsoft.Office.Tools.CustomTaskPane.Dispose method of the CustomTaskPane has already been called. |
| COMException | The value of the DockPositionRestrict property is Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRestrictNoChange when you try to change the value of the DockPosition property. -or- You try to set this property in the event handler for the DockPositionChanged or VisibleChanged event. |
The following table lists the values of the Microsoft.Office.Core.MsoCTPDockPosition enumeration.
Value | Description |
|---|---|
msoCTPDockPositionLeft | Docks the custom task pane to the left side of the window. |
msoCTPDockPositionTop | Docks the custom task pane to the top of the window. |
msoCTPDockPositionRight | Docks the custom task pane to the right side of the window. |
msoCTPDockPositionBottom | Docks the custom task pane to the bottom of the window. |
msoCTPDockPositionFloating | Displays the custom task pane in front of the window. The user can drag the task pane to any location in the window. |
The following code example creates a custom task pane and configures different default sizes for when the pane displays in front of the active application window, and when it is docked. This code example is part of a larger example provided for CustomTaskPane.