Subscribe (RSS)

Quick Links

About Actipro

Actipro Software has been creating .NET user interface control products for Windows Forms since its inception. More recently, Actipro has become a pioneer in the .NET 3.0 WPF control development arena.

Where did my Ribbon go? Ribbon hides at run-time after designing with VS 2008

by Bill Henning (Actipro) March 6, 2008 at 22:38

This is an issue that a couple customers have run into and emailed us on, so we wanted to post more about it. 

Scenario

The scenario is that you drag a Ribbon onto a Window and everything shows up fine at design-time.    But when you go to run your application, you see a blank Window.

Why Did It Disappear?

What happened was that you probably clicked and dragged something somewhere in the Visual Studio designer that either:

  • Set the Width or Height of the Ribbon to an explicit size (very bad)
  • Set the Margin around the Ribbon to something that forces it to have a smaller than desired size
  • Did the above things to a direct container of Ribbon that affects its size

At run-time a feature of Ribbon is to collapses when there is not enough space for it.  You have full control over the threshold size at which this collapse occurs.  But one of the items in the list above would have caused this collapse code to kick in because the Ribbon is being forced smaller than desired.

Resolution

To fix this problem, simply look at the XAML for your Ribbon tag and remove any Width/Height property settings.  Also check to ensure that a Margin isn't set that could be causing this.  Then run your application and everything should appear like you would expect since now the Ribbon is not being forced to a small size.

Why Does It Show at Design-Time?

In the designer we force Ribbon to stay expanded and ignore its normal run-time collapse behavior.  This is done so that you can properly visually design the Ribbon.

Further Reading

We also have a section explaining this issue in the Ribbon control's Troubleshooting topic in the product documentation.

Comments

March 10, 2008 at 01:38  

gu

If some many users had problems with this "disappearing feature", don't you think it would be better to change the behaviour?
Example: Default is to show the Ribbon Bar at runtime even if it does not fit properly?

gu

March 10, 2008 at 07:35  

Bill Henning (Actipro)

Actually we've only had two customers ask about this.  It is normally a desired run-time feature.  Let me explain some more.

The official Microsoft Ribbon UI Guidelines have this item:
"The entire Ribbon SHOULD completely disappear when the application window is less than 300 pixels wide and 250 pixels tall to provide more space for displaying the document."

That is the feature that we have implemented.  You have control over the threshold size (defaults to 300, 250) and can prevent it from occurring at all if you set Ribbon.IsCollapsible to false.

But again, this issue is not a bug in our control and is more an issue with people accidentally dragging something in the Visual Studio designer that forces the Ribbon to be below the collapse threshold size.  As long as you don't accidentally set a hardcoded width/height on the ribbon in the designer, it will work properly at run-time and will give end users a good user experience.

Bill Henning (Actipro)

March 22, 2010 at 06:30  

Michael Sync

How to remove this limitation? I think it doesn't make sense even it's from official MS Ribbon UI guideline...

Michael Sync Singapore

March 22, 2010 at 13:03  

Bill Henning (Actipro)

Michael,

We let you alter the collapse threshold size if you'd like, and also the IsCollapsible property can be set to false to prevent it from happening at all.

Bill Henning (Actipro) United States

March 23, 2010 at 10:21  

Michael Sync

Actually, we just want to reduce the height of Ribbon. I couldn't find any straightforward way to do that. So, we end up changing the whole style plus overriding the GroupPresenter.. Changing the height of Ribbon shouldn't be that difficult.  

Michael Sync Singapore

Comments are closed