ComponentFactory.Krypton.Toolkit.VisualControlBase.OnLayout C# (CSharp) Method

OnLayout() protected method

Raises the Layout event.
protected OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void
levent System.Windows.Forms.LayoutEventArgs A LayoutEventArgs that contains the event data.
return void
        protected override void OnLayout(LayoutEventArgs levent)
        {
            // Cannot process a message for a disposed control
            if (!IsDisposed && !Disposing)
            {
                // Do we have a manager to use for laying out?
                if (ViewManager != null)
                {
                    // Prevent infinite loop by looping a maximum number of times
                    int max = 5;

                    do
                    {
                        // Layout cannot now be dirty
                        _layoutDirty = false;

                        // Ask the view to peform a layout
                        ViewManager.Layout(_renderer);

                    } while (_layoutDirty && (max-- > 0));
                }
            }

            // Let base class layout child controls
            base.OnLayout(levent);
        }