In This Article

Item Context Menus

Context menus can be generated dynamically upon request by items.

Dynamically Creating Context Menus

The TreeListBox.ItemMenuRequested event is raised whenever a context menu is required for an item. The event is passed arguments of type TreeListBoxItemMenuEventArgs, which specifies the related Item and its UI Container.

No context menu is automatically created by default. It is up to you to set the TreeListBoxItemMenuEventArgs.Menu property to a menu you generate. Responding to the event allows you to dynamically build a menu based on the context of the item.