ArcObjects Library Reference (Controls)  

IToolbarControlEvents.OnBuddyChanged Event

Fires after the ToolbarControl Buddy is set.

[Visual Basic 6.0]
Event OnBuddyChanged As Empty
[Visual Basic .NET]
Public Event OnBuddyChanged As OnBuddyChangedEventHandler
[C#]
public event OnBuddyChangedEventHandler OnBuddyChanged
[C++]
HRESULT OnBuddyChanged(
void
);

Product Availability

Available with ArcGIS Engine.

Description

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