Maximize and Restore bux fixed

Jun 18, 2009 at 4:39 PM
Edited Jun 18, 2009 at 4:40 PM

Hi, a fix a bug of change the type of RibbonCaptionButton that was no change bettwewn Maximize and Restore.

On RibbonCaptionButton.cs implements this methods:

internal override void SetOwner(Ribbon owner) {

if (this.CaptionButtonType == CaptionButton.Restore || this.CaptionButtonType == CaptionButton.Maximize) {
if (owner != null && owner.FindForm() != null) owner.FindForm().SizeChanged += new EventHandler(OwnerForm_SizeChanged); 

private void OwnerForm_SizeChanged(object sender, EventArgs e) {
switch ((sender as Form).WindowState) {
case FormWindowState.Maximized: SetCaptionButtonType(CaptionButton.Restore); break;
case FormWindowState.Normal: SetCaptionButtonType(CaptionButton.Maximize); break;

And in Ribbon.cs move this section of code on constructor:


 To a new override method of InitLayout(), like this:

protected override void InitLayout() {

because on contructor the method FindForm() was returning null.



May 16, 2013 at 1:26 PM
Hi, a new version of Ribbon is released. Please visit the new site for latest fixes, releases, information and downloads.
New site: