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

IToolbarControlEvents.OnBuddyChanged Event (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControlEvents Interface > IToolbarControlEvents.OnBuddyChanged Event
ArcGIS Developer Help

IToolbarControlEvents.OnBuddyChanged Event

Fires after the ToolbarControl Buddy is set.

[Visual Basic .NET]
Public Event OnBuddyChanged As OnBuddyChangedEventHandler
public event OnBuddyChangedEventHandler OnBuddyChanged
HRESULT OnBuddyChanged(

Product Availability

Available with ArcGIS Engine.


Fires when the SetBuddyControl method is used.

Any custom commands that are added to the ToolbarControl must be written in such a way as to ask the ToolbarControl for its Buddy every time an operation is requested to ensure they are always working with the current Buddy. Custom commands need to do one of two things:

ICommand::OnCreate will only get called once for each command that is added to the ToolbarControl the first time the Buddy is set. Using the SetBuddyControl method to change the buddy a subsequent time will not call ICommand::OnCreate, but will fire the OnBuddyChanged event.

See Also

IToolbarControlEvents Interface