RibbonSplitButton is shown large icon when Task pane and RibbonButton is visible on other tab in simplified ribbon mode
Microsoft® Outlook® voor Microsoft 365 MSO (Versie 2202 Build 16.0.14931.20008) 32 bits
Steps to reproduce:
- Start Visual Studio
- Create a VSTO project for Outlook
- Add a ribbon (visual designer)
- Place a button in first ribbon tab
- Place a RibbonSplitButton on a second tab
- Set ControlID of second ribbon to Office:TabMail
- Create a Ribbon_Load event, and place similar code as below:
public partial class OutlookRibbon
{
private void OutlookRibbon_Load(object sender, RibbonUIEventArgs e)
{
CreatePanel();
}
public void CreatePanel()
{
var pane = Globals.ThisAddIn.CustomTaskPanes.Add(new PaneUserControl(), "task window");
// When there is a button (button1) on the TabAddin ribbon AND
// If visible is true, then the splitbuttons are drawn to big.
// if visible is false , then the splitbuttons drawn OK.
pane.Visible = true;
}
}
- Start the project (Outlook should start and the custom button should be visible on the start ribbon)
What is the problem?
The RibbonSplitButton is too large in simplified Outlook ribbon.
How should it work?
The 'New document' button should be small in simplified ribbon mode.
What is causing the problem?
The combination of
- a RibbonButton on the first ribbon
- AND a RibbonSplitButton (with ControlSize set to 'RibbonControlSizeLarge') on the second ribbon (which is placed in the Start ribbon)
- AND a visible taskpane
- AND a simplified ribbon (default in Outlook 365) on start up
If I remove the RibbonButton on the first ribbon, then the RibbonSplitButton is shown normally.
If I hide the task pane, then the RibbonSplitButton is shown normally
If I move the creation or visibility of the Task pane to ThisAddin.ThisAddIn_Startup(), then the RibbonSplitButton is shown normally
If I switch from Start tab to another tab and back, the RibbonSplitButton is shown normally
We have moved the creation of the pane to the ThisAddin.ThisAddIn_Startup() method in our production application, but we would like to know what is causing this problem and how we can cope with it.
Is there a repaint() method or something we can call to repair the button?
-