1

The Problem

I'm trying to add a new button to a button group using the Visual Ribbon Designer for a Word VSTO Add-In in Visual Studio 2017. When I drag a button over a button group, I normally see options for placement represented by black lines. However, when I drag the new button over a particular button group, I get the 'unavailable' cursor, as seen in the first screenshot below.

I have yet to figure out what's preventing me from adding a new button.

Screenshots

1.

Screenshot 1 - Adding a button is not available.

2.

Screenshot 2 - Click-to-add adds a button to the beginning (or end) only.

Research and Attempts

  • The button group in question is not Locked.
  • There doesn't seem to be a maximum to the number of buttons I can add to a button group.
  • If I add a new group or button group, I am able to add new buttons as usual.
  • If I try the 'click the ribbon control, then click where you want it' method of adding a control, I can add a button to the button group, but only to the beginning or end (screenshot 2).
  • I can add the button control wherever I want if I edit Ribbon.Designer.cs manually, though I'm loath to do have to always do that.

Video!

enter image description here

ebwb
  • 264
  • 5
  • 20
  • can you try to copy/paste an existing button ? – Malick Dec 11 '18 at 17:59
  • Ah! Thanks. I'd forgotten to mention that I could do that, but it doesn't work in the way you'd want or expect. I'll update the question. – ebwb Dec 11 '18 at 18:07
  • then can you move it by code in `Ribbon.Designer.cs` ? (change the add order.) – Malick Dec 11 '18 at 18:17
  • Yes - I'm able to place it wherever I want by writing the normally auto-generated code for it, and that's what I've been doing so far. – ebwb Dec 11 '18 at 18:22
  • 1
    ok, I think I had a similar problem once, I have edited the auto generated code to solve it. Let's see if someone has a proper answer and explanation. – Malick Dec 11 '18 at 18:31
  • do you take the button from the "ribbon office" group in the tool panel ? – Malick Dec 11 '18 at 18:32
  • Hmm.. In my toolbox, it's called "Office Ribbon Controls". Is that the same thing? It's one of the toolbox sections that automatically shows up when I select the `Ribbon.cs [Design]` tab. – ebwb Dec 11 '18 at 18:36
  • 1
    yes this is the section I'm talking. Sorry I have no other ideas. – Malick Dec 11 '18 at 18:37
  • I can't recall ever having seen this before, or mention of it. I have to wonder whether something has been "corrupted"... If you delete the entire group (the code behind will remain intact!) then recreate it (and just link the buttons to the existing code)? – Cindy Meister Dec 11 '18 at 19:33
  • If I create a new group (either a new group next to the offending group, or a new group to replace the offending group), I'm able to add buttons. Others on this project don't have this issue, though, and the problem remains even if I pull down a fresh copy of the solution from our version control. – ebwb Dec 11 '18 at 20:32

1 Answers1

0

I still don't have an answer, but I do have a workaround!

If I hold the left mouse button while dragging the button toward the offending group, and I click and release the right-click button while hovering over that group, the glyph appears indicating that it is legal to drop the button in that spot.

Video

A video showing that, with right-clicking, I can add a button to a group that, until now, wasn't allowing me to drop a button there.

ebwb
  • 264
  • 5
  • 20