ToolPane.SelectedWebPart property

Gets the currently selected WebPart.

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

Syntax

'Declaration
Public ReadOnly Property SelectedWebPart As WebPart
    Get
'Usage
Dim instance As ToolPane
Dim value As WebPart

value = instance.SelectedWebPart
public WebPart SelectedWebPart { get; }

Property value

Type: Microsoft.SharePoint.WebPartPages.WebPart
The Web Part that is currently selected.

Remarks

Use this property in views where Web Part selection is supported, such as the Extensible view and the Properties view. If no Web Part is selected, or the view does not support selection, the SelectedWebPart property returns a null reference (Nothing in Visual Basic). Setting this property causes the tool pane to close and reopen in the same view.

See also

Reference

ToolPane class

ToolPane members

Microsoft.SharePoint.WebPartPages namespace