This project is read-only.

QuickAccessControl SplitButton Opened event

Jan 11, 2012 at 8:48 AM


I have a SplitButton where the drop down menu is created or updated dynamically in the SplitButton.DropDownOpened event. This works fine.

I also add that SplitButton to the QuickAccess menu, so the code looks something like this:

SplitButton sb = new SplitButton();
sb.DropDownOpened += (s, e) => _CreateOrUpdateDropDown(sb);
ribbon.QuickAccessItems.Add(new QuickAccessMenuItem()
    Target = sb,

The problem is now when the user opens the dropdown menu of the QuickAccess item, that event is not fired and as a result the menu is not up to date. How can I avoid this?

Jan 11, 2012 at 10:28 AM

Also, is there a way to add only the main button of the SplitButton without the dropdown to the QuickAccess menu programmatically?

Jan 11, 2012 at 10:34 AM
Edited Jan 11, 2012 at 10:34 AM

I found [workitem:19095] where this was fixed for DropDownButtons by adding


            if (DropDownClosed != null) button.DropDownClosed += DropDownClosed;
            if (DropDownOpened != null) button.DropDownOpened += DropDownOpened;

to DropDownButton.CreateQuickAccessItem. Could the same be added to SplitButton.CreateQuickAccessItem?

Jan 12, 2012 at 2:30 PM

I created [workitem:22045] and attached patch 11254 for the above.

Then it almost works, except for the first time. I created [workitem:22057] and added patch 11264 to deal with that as well.