How To Add Ribbon Roll-Up Button

Jul 13, 2012 at 4:27 PM

This is something I have seen used in Outlook 2010, bit of an ugly method here but this works a treat for me.

 

private void btnRibbontoggle_Click(object sender, EventArgs e)
        {
            if (btnRibbontoggle.Text == "v")
            {
                btnRibbontoggle.Text = "ʌ";
                Size s = rbnMain.Size;
                rbnMain.Size = new Size(s.Width, 112);

                for (int i = 0; i < rbnMain.Tabs.Count; i++)
                {
                    for (int j = 0; j < rbnMain.Tabs[i].Panels.Count; j++)
                    {
                        rbnMain.Tabs[i].Panels[j].Visible = true;
                    }

                }
            }
            else
            {
                btnRibbontoggle.Text = "v";
                Size s = rbnMain.Size;
                rbnMain.Size = new Size(s.Width, 23);

                for (int i = 0; i < rbnMain.Tabs.Count; i++)
                {
                    for (int j = 0; j < rbnMain.Tabs[i].Panels.Count; j++)
                    {
                        rbnMain.Tabs[i].Panels[j].Visible = false;
                    }
                }
            }
        }

Coordinator
Jan 6, 2013 at 6:56 PM

Are you trying to mimic the Minimize feature here?