Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
How can I make RibbonTabs transparent and show underlying form
posted

I tried to get the following but did not find the right set of properties to modify.

I have a Windows forms application with an UltraToolbarsManager which displays a Ribbon with all its RibbonTabs collapsed. When the user clicks on a tab caption and that tab is displayed, I would like to display that tab in a semi-transparent way letting the form show through the tab transparency.

First, is it possible to do that?
Second, how can I do that?

Thanks

Parents
No Data
Reply
  • 44743
    posted

    There is currently no property to do this. However, you could use a creation filter to accomplish this. Add the following class to your project and in the constructor of your Form, create a new instance of it and assign it to the CreationFilter property of your UltraToolbarsManager:

    public class OpacityCreationFilter : IUIElementCreationFilter
    {
     private UltraToolbarsManager manager;

     public OpacityCreationFilter( UltraToolbarsManager manager )
     {
      this.manager = manager;
     }

     void IUIElementCreationFilter.AfterCreateChildElements( UIElement parent ) { }

     bool IUIElementCreationFilter.BeforeCreateChildElements( UIElement parent )
     {
      if ( parent is RibbonTabPageUIElement && this.manager.Ribbon.IsMinimized )
      {
       Form form = parent.Control.FindForm();

       const float opacity = 0.6f;

       if ( form != null && form.Opacity != opacity )
        form.Opacity = opacity;
      }

      return false;
     }
    }

     

Children