简体   繁体   中英

Ribbon bar designer shows empty ribbon control for VSTO Excel Application in Visual Studio 2019

I have a C# add-in that I am developing in Visual Studio 2019.

  • I have a single custom ribbon control that appears as a new tab in Excel whenever I run the add-in.
  • The NBWRibbon01.Designer.cs contains code for the custom ribbon groups and buttons shown below.
  • The application builds and runs without error.

运行 Excel 加载项时出现的自定义功能区。

However, when I launch the Designer for the same custom ribbon in Visual Studio 2019, I get an empty ribbon bar control shown below.

Visual Studio 2019 中相同功能区栏的功能区设计器

Has anyone encountered this issue? I am guessing that I will need to completely re-create the ribbon bar from scratch.

First of all, make sure the VSTO design-time adapter add-in is enabled in Excel.

VSTO 设计时适配器加载项

Also check out the code-behind files, most probably any of them was edited to ruin the ribbon designer.

The Ribbon designer is good as a starting point in Visual Studio. But it doesn't support all the features that the Fluent UI provides. So, I'd suggest moving to the raw XML markup. You can design the base UI using the ribbon designer in Visual Studio and then export the custom markup to the ribbon XML. Read more about that in the How to: Export a ribbon from the Ribbon Designer to Ribbon XML article.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM