I'm using a XML ribbon for an Excel add-in with C#. I'm new at this so I hope I have not misunderstood how it works. I have a SplitButton containing a button and a menu. I'd like the menu to open up when clicking the button just like if I clicked the caret.
What I have in XML:
<splitButton id="_mySplitButton" size="large">
<button id="_mySplitButton__btn" onAction="ShowMenu"/>
<menu id="_mySplitButton__mnu">
<!-- buttons here -->
</menu>
</splitButton>
What I have in C#:
public void ShowMenu(IRibbonControl control)
{
// Open the dropdown here
RibbonButton button = control as RibbonButton; // --> null
}
Unfortunately, I have no idea how to get to the menu dropdown. I cannot cast the callback parameter, nor can I access the control programmatically, as I've seen on several posts. So I'm wondering, is there any way to achieve this?
I ended up finding a solution: using menus instead of splitbuttons. The menu's / splitbutton's appearance is the same, but a menu will open itself upon hovering or clicking, which is what I needed.