RibbonSplitButton is shown large icon when Task pane and RibbonButton is visible on other tab in simplified ribbon mode

Robin Bouwmeester 21 Reputation points
2022-02-22T13:21:13.73+00:00

Microsoft® Outlook® voor Microsoft 365 MSO (Versie 2202 Build 16.0.14931.20008) 32 bits

Steps to reproduce:

  1. Start Visual Studio
  2. Create a VSTO project for Outlook
  3. Add a ribbon (visual designer)
  4. Place a button in first ribbon tab
  5. Place a RibbonSplitButton on a second tab
  6. Set ControlID of second ribbon to Office:TabMail
  7. 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;

}
}

  1. 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.

176790-image.png

How should it work?
The 'New document' button should be small in simplified ribbon mode.

176740-image.png

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

176807-image.png
176862-image.png

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?

-

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,867 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,198 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.