This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControlEvents Interface > IToolbarControlEvents.OnBuddyChanged Event (ArcObjects .NET 10.5 SDK) |
Fires after the ToolbarControl Buddy is set.
[Visual Basic .NET] Public Event OnBuddyChanged As OnBuddyChangedEventHandler
[C#] public event OnBuddyChangedEventHandler OnBuddyChanged
[C++]
HRESULT OnBuddyChanged(
void
);
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.