Share via


ToolPane.InsertToolPart Method

Adds the specified ToolPart to the tool pane.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Sub InsertToolPart ( _
    index As Integer, _
    tp As ToolPart _
)
'Usage
Dim instance As ToolPane
Dim index As Integer
Dim tp As ToolPart

instance.InsertToolPart(index, tp)
public void InsertToolPart(
    int index,
    ToolPart tp
)

Parameters

  • index
    Type: System.Int32

    The position of the tool part among the existing tool parts. If the specified position exceeds the number of tool parts already in the list, the tool part will be added at the end.

Remarks

The InsertToolPart method can be used in the CreateToolPaneControlsmethod of the Microsoft.SharePoint.WebPartPages.ICustomizeToolPaneinterface in a Web Part that customizes the tool pane, to insert custom or standard tool parts into the tool pane in the desired order.

Examples

The following code example demonstrates the use of the InsertToolPart method to insert a custom tool part, ToolPart1, into the tool pane, tp, followed by the standard tool parts.

Dim myToolPart1 As ToolPart = New ToolPart1
tp.InsertToolPart(0, myToolPart1)
Dim standardToolPart As ToolPart= New Microsoft.SharePoint.WebPartPages.WebPartToolPart
tp.InsertToolPart(1, standardToolPart)
ToolPart myToolPart1 = new ToolPart1();
tp.InsertToolPart(0, myToolPart1);
ToolPart standardToolPart = new Microsoft.SharePoint.WebPartPages.WebPartToolPart();
tp.InsertToolPart(1, standardToolPart);

See Also

Reference

ToolPane Class

ToolPane Members

Microsoft.SharePoint.WebPartPages Namespace