ComponentFactory.Krypton.Toolkit.RenderStandard.ContentPaddingForButtonForm C# (CSharp) Method

ContentPaddingForButtonForm() private static method

private static ContentPaddingForButtonForm ( Padding original, ViewLayoutContext context, int allocatedHeight ) : Padding
original Padding
context ViewLayoutContext
allocatedHeight int
return Padding
        private static Padding ContentPaddingForButtonForm(Padding original,
                                                           ViewLayoutContext context,
                                                           int allocatedHeight)
        {
            // Get the krypton form that contains this control
            KryptonForm kryptonForm = OwningKryptonForm(context.TopControl);

            // Not interested if not inside a krypton form
            if (kryptonForm != null)
            {
                // Get the padding just for the chrome borders
                Padding chromeBorders = kryptonForm.RealWindowBorders;

                // How much border space to allocate per button edge
                int buttonBorder = (chromeBorders.Top - allocatedHeight - 10) / 2;

                if (buttonBorder > 0)
                    return new Padding(buttonBorder);
                else
                    return Padding.Empty;
            }

            return original;
        }
RenderStandard