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
400
Ribbon Length.
posted

Hello,

 

 I need to set the ribbon length to ribbon group created for that particular ribbon tab.

 

Please suggest me how to set the ribbon length during run time or even during design. Please provide all the options available to set the ribbon length.

Parents
No Data
Reply
  • 400
    Verified Answer
    posted

    Hello Petar,

    I had gone through the documentation link sent. Finally i wrote the coding successfully. Let me provide the code which may be useful for our members.

     

    // Insert this line in the Form Load Event.


                ultraToolbarsManager1.CreationFilter = new class1();

    // Add this class


        public partial class class1 : IUIElementCreationFilter
        {
            #region IUIElementCreationFilter Members
            public void AfterCreateChildElements(UIElement parent)
            {
              RibbonTabPageUIElement    ribbArea10 = parent as RibbonTabPageUIElement;


                if (ribbArea10 != null)
                {
                    Rectangle newRect = new Rectangle(ribbArea10.Rect.X, ribbArea10.Rect.Y, 400, ribbArea10.Rect.Height);
                    ribbArea10.Rect = newRect;
                }
            }
            public bool BeforeCreateChildElements(UIElement parent)
            {
                return false;
            }
            #endregion

    }

    The code above provided is for the reduction of the RibbonTab alone.

    It can also be done for quickaccesstoobbar, tabitemtoolbar CaptionArea, CaptionButton by using the appropiate Uielement class at Italized point.

    Once again Thankyou Petar for the Guidance Provided.

Children
No Data