Programming Microsoft® Composite UI Application Block and Smart Client Software Factory
by David S. Platt
F. ToolStrips
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access