F. ToolStrips

  1. A programmer may also want to add ToolStripButtons to any ToolStrip extension sites that the shell developer provides. This procedure works in the same manner as for MenuStrip items and StatusStrip items. This shouldn't surprise you because they share the same common base class of ToolStripItem. We fetch the UIExtensionSite from the WorkItem by means of its name, create the ToolStripButton we want to add, and tack them on using the method UIExtensionSite.Add( ).

    In the case of a toolbar button, which exists to fire commands, we also want to add an invoker, which we do in the same way as we did for the menu example. In the sample code shown on the facing page, we wire the new toolbar button to the same handler function that the first ...

Get Programming Microsoft® Composite UI Application Block and Smart Client Software Factory now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.