共用方式為


ToolPane.InsertToolPart method

將指定的ToolPart加入至 [工具] 窗格。

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Sub InsertToolPart ( _
    index As Integer, _
    tp As ToolPart _
)
'用途
Dim instance As ToolPane
Dim index As Integer
Dim tp As ToolPart

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

參數

  • index
    Type: System.Int32

    工具組件之間現有的工具組件的位置。如果指定的位置超過已經在清單中的工具組件數目,會在結尾加入工具組件。

備註

InsertToolPart方法可以用於CreateToolPaneControlsMicrosoft.SharePoint.WebPartPages.ICustomizeToolPane介面方法自訂 [工具] 窗格的 [自訂] 或 [標準工具組件中插入 [工具] 窗格中您想要的順序的網頁組件。

Examples

下列程式碼範例示範使用 [工具] 窗格, tp,後面接著的標準工具組件中插入自訂工具組件, ToolPart1, InsertToolPart方法。

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);

請參閱

參照

ToolPane class

ToolPane members

Microsoft.SharePoint.WebPartPages namespace