Partager via


ToolPane Class

The ToolPane class represents the tool pane on a Web Part Page. This class cannot be inherited.

System.Object

      System.Web.UI.Control

            Microsoft.SharePoint.WebPartPages.ToolPane

Public Constructors

The following table shows the constructors of the ToolPane class and a brief description of each.

Name Description
ToolPane Initializes a new instance of the ToolPane class.

Events

The following table shows the events of the ToolPane class and a brief description of each.

Name Description
ErrorOccurred Occurs when a tool pane error occurs.
ViewChanged Occurs after the tool pane view changes.
ViewChanging Occurs before the tool pane view changes.

Public Methods

The following table shows the public methods of the ToolPane class and a brief description of each.

Name Description
CreateZoneDropdown(Microsoft.SharePoint.WebPartPages.WebPartPage) Creates a drop down list control filled with the list of zones on the page to which the user can add Web Parts.
GetShowExtensibleToolPaneEvent(String) Returns a string of JavaScript which, if executed on the client, causes the extensible tool pane to open for the specified Web Part.
GetShowToolPaneEvent(Microsoft.SharePoint.WebPartPages.WebPart, ToolPane.ToolPaneView Returns a string of JavaScript which, if executed on the client, cause a tool pane to open in the specified view for the specified Web Part.
InsertToolPart(Int32, Microsoft.SharePoint.WebPartPages.ToolPart) Adds a tool part to the tool pane.
RemoveToolPart(Microsoft.SharePoint.WebPartPages.ToolPart) Removes a tool part from the tool pane.

Protected Methods

The following table shows the protected methods of the ToolPane class and a brief description of each.

Name Description
CreateChildControls Notifies server controls to create any child controls that they contain in preparation for posting back or rendering.
Render(System.Web.UI.HtmlTextWriter) Sends server control content to the specified System.Web.UI.HtmlTextWriter, which writes the content to be rendered to the client.

Public Properties

The following table shows the properties of the ToolPane class, the data type of each property, and a brief description of each.

Name Data Type Description
Apply System.Web.UI.WebControls.Button A System.Web.UI.WebControls.Button that represents the Apply button of the tool pane.
Cancel System.Web.UI.WebControls.Button A System.Web.UI.WebControls.Button that represents the Cancel button of the tool pane.
CommandUI System.Web.UI.WebControls.PlaceHolder A System.Web.UI.WebControls.PlaceHolder that represents the command area of the tool pane.
ErrorText String The text displayed in the tool pane when an error occurs.
FixedAreas System.Collections.ArrayList A list of the areas of the tool pane that can contain links or controls.
InCustomToolPane Boolean A value indicating whether the tool pane is hosted in the toolpane.aspx page within a Windows SharePoint Services-aware HTML editor such as Office FrontPage 2003 or another client application.
NeedLayoutCanvas Boolean A value indicating whether the layout canvas of the Web Part page is displayed.
NotifyUI System.Web.UI.WebControls.PlaceHolder A System.Web.UI.WebControls.PlaceHolder that you can use to insert controls in the notification area of the tool pane.
OK System.Web.UI.WebControls.Button A System.Web.UI.WebControls.Button that represents the OK button of the tool pane.
SelectedWebPart Microsoft.SharePoint.WebPartPages.WebPart The selected Web Part.
SelectedZone Microsoft.SharePoint.WebPartPages.WebPartZone The selected Web Part zone.
ToolParts System.Collections.ArrayList An array of the tool parts in the tool pane.
View Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView The current view of the tool pane.
Width System.Web.UI.WebControls.Unit The minimum width of the tool pane.

Example

The following example demonstrates the use of the ToolPane class and the three methods of the ICustomizeToolPane interface in a simple Web Part. The RenderWebPart method uses the GetShowExtensibleToolPaneEvent to associate a button control on the Web Part with the JavaScript required to open the extensible tool pane. The ToolPaneTemplate property provides the layout of the tool pane, while the CreateToolPaneControls method draws the tool pane's controls.

Requirements

Namespace: Microsoft.SharePoint.WebPartPages

Platforms: Microsoft Windows Server 2003

Assembly: Microsoft Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security