Problem/Glitch with Hide Method

Jan 11, 2011 at 2:14 PM

After calling the Hide method, the ribbon remains visible and functional, and the ClientSize extends to the top of the window border.

So, when I dock a Panel or SplitContainer (or any control for that matter) below the ribbon and then call, for example Ribbon1.Hide(), the container or control that was docked extends underneath the ribbon to the top of the window border with the Ribbon sitting on top of it.

Any workaround or suggestions would be appreciated.

Thanks again.

Jan 12, 2011 at 5:01 PM

I confirm that this is a bug in Ribbon class (Version 2.6)

Hide method is the same as Visible = false

Workaround:

 

ribbon.Visible = false;

ribbon.Viewable = false;

 

You can also download the latest Ribbon.cs here in Source Code tab. It contains two fixes: Visible property and Maximize/Minimize workaround.

Jan 13, 2011 at 2:43 AM

Thanks, Bernhard.  Here are my results.


Using ribbon.Visible = false worked in terms of making the ribbon not visible, but the top of whichever container/control is docked below the ribbon still extends to the top of the form border.  So, if I put a Button control at the top of a panel and then set the dockStyle of the panel to fill, after calling ribbon.Visible = false the Panel seems to fall out of the client area and the Button within the Panel gets hidden underneath the top of the form border.

Using ribbon.Viewable = false seemed to produce the expected result.  After calling ribbon.Viewable = false with a Panel docked below the ribbon with its dockStyle set to Fill, the ribbon disappeared and the Panel remained inside the client area and all child controls of the panel remained completely visible.  Problem solved.  so it seemed...


So, it seemed my problem was solved with ribbon.Viewable.  However, I thought I would try the updated Ribbon.cs (windowsribbon-56090), and now…

ribbon.hide produces the same result as ribbon.visible, which is any docked container or control below the ribbon falls out of the client area underneath the top of the form border.

ribbon.visible = false has the same result (no change), which is any docked container or control below the ribbon falls out of the client area underneath the top of the form border.

ribbon.viewable = false seems to no longer exist.  In fact, when I try building sample application #15 (ContextPopup), it fails in the form load event when “_ribbon.Viewable = False” is called.  It says “‘Viewable’ is not a member of RibbonLib.Ribbon”.


Now I’m concerned.  ribbon.Viewable = false was the only thing that worked, but now with the updated source code, it doesn’t work…


By the way, the workaround for the minimizing/maximizing problem seems to be fine in the new source code.  Thanks again.

Jan 13, 2011 at 5:47 AM

I was able to reproduce the behaviour from above and revert the changes to Visible and Viewable property to its previous state. To make Visible property work as expected it would be necessarry to override it, but this is not possible.

Solution now:

- Use Viewable property