ComponentFactory.Krypton.Ribbon.VisualPopupGroup.OnLayout C# (CSharp) Method

OnLayout() protected method

Raises the Layout event.
protected OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void
levent System.Windows.Forms.LayoutEventArgs An EventArgs that contains the event data.
return void
        protected override void OnLayout(LayoutEventArgs levent)
        {
            // Let base class calulcate fill rectangle
            base.OnLayout(levent);

            // Ribbon shape determines the border rounding required
            int borderRounding;
            switch (_ribbon.RibbonShape)
            {
                default:
                case PaletteRibbonShape.Office2007:
                    borderRounding = 2;
                    break;
                case PaletteRibbonShape.Office2010:
                    borderRounding = 1;
                    break;
            }

            // Update the region of the popup to be the border path
            using (GraphicsPath roundPath = CommonHelper.RoundedRectanglePath(ClientRectangle, borderRounding))
                Region = new Region(roundPath);
        }