This document is archived and information here might be outdated.  Recommended version.


ITOCControlDefault.SetBuddyControl Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > ITOCControlDefault Interface > ITOCControlDefault.SetBuddyControl Method
ArcGIS Developer Help

ITOCControlDefault.SetBuddyControl Method

Sets a control to be a buddy of the toolbar, this control must support ITOCBuddy.

[Visual Basic .NET]
Public Sub SetBuddyControl ( _
    ByVal pTOCBuddy As Object _
)
[C#]
public void SetBuddyControl (
    object pTOCBuddy
);
[C++]
HRESULT SetBuddyControl(
  IDispatch* pTOCBuddy
);
[C++]
Parameters
pTOCBuddy [in]

pTOCBuddy is a parameter of type IDispatch

Product Availability

Available with ArcGIS Engine.

Description

Pass the SetBuddyControl method a MapControl, PageLayoutControl, SceneControl, GlobeControl or object implementing ITOCBuddy whose ActiveView is passed to the TOCControl to enable it to populate itself with maps, layers and symbols. By default no buddy is set. To clear the Buddy set the property to Nothing.

Errors Returned

1039 800a040f: The supplied buddy is not a supported object

[C#]
axTOCControl1.SetBuddyControl(null);
[Visual Basic .NET]
AxTOCControl1.SetBuddyControl(Nothing)

See Also

ITOCControlDefault Interface