/// <summary> /// Hears button clicks for any custom CommandBarComboBox. /// <seealso cref="Microsoft.Office._CommandBarComboBoxEvents_ChangeEventHandler"/> /// </summary> /// <param name="Ctrl">The combo box that was changed.</param> private void combo_Change(CommandBarComboBox Ctrl) { ToolbarComboBox control = (ToolbarComboBox)controlControlMap[Ctrl.Tag]; OfficeWindow window = (OfficeWindow)controlWindowMap[Ctrl.Tag]; control.OnChange(window); }
/// <summary> /// Create a new control of a particular type. /// </summary> /// <param name="type">The type of control to create.</param> /// <returns>One of ToolbarPopup, ToolbarButton and ToolbarComboBox depending on the type given.</returns> private ToolbarControl CreateControl(MsoControlType type) { ToolbarControl control = null; switch (type) { case MsoControlType.msoControlPopup: control = new ToolbarPopup(this); break; case MsoControlType.msoControlButton: control = new ToolbarButton(this); break; case MsoControlType.msoControlEdit: case MsoControlType.msoControlDropdown: case MsoControlType.msoControlComboBox: control = new ToolbarComboBox(this, type); break; } if (control != null) { control.InternalTag = InternalTag + "_" + NEXT_TAG; NEXT_TAG++; } return(control); }