ArcObjects Library Reference (Controls)  

ITOCControl.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

ITOCControl Interface