Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Programmatically minimize the ribbon Collapse All
Subject Author Date
Mark Matthews May 14, 2009 - 5:24 PM

I know I can minimize the ribbon through, say, a button press by using the command


ribbon1.Minimized = true;


and it works fine.


However, when I try to minimize it inside the ribbon1_CurrentTabPageChanged function it goes to the "Temporarily displayed controls" state as shown in figure 2 of this link:


http://www.prof-uis.com/elegant-ribbon/feature-tour/dotnet_minimize_the_ribbon.aspx#@lt;/p>

I need it to look like figure 1.  Basically I’m trying to hide the ribbon for a certain tab.


Thanks


 

Technical Support May 25, 2009 - 11:26 AM

Although it is not the standard behavior, you can implement it like this:

private void ribbon1_PreviewMouseDown(object sender, Elegant.Ui.PreviewMouseEventArgs e)
{
           if (!ribbon1.Minimized)
           {
                System.Windows.Forms.Control control = ribbon1.GetChildAtPoint(e.Location);
                if (control != null && control.GetType().Name == "RibbonTab" 
                                 && control.Text == ribbonTabPage2.Text 
                                 && ribbon1.CurrentTabPage != ribbonTabPage2)
                {
                    e.Handled = true;
                    ribbon1.Minimized = true;
                }
            }
}
First, you should handle the ribbon’s PreviewMouseDown event. As you can see in the code above, the ribbonTabPage2 is an instance of RibbonTabPage and, when selected, it minimizes the ribbon.

Mark Matthews May 26, 2009 - 6:45 PM

Thanks, I will give it a try.