ComponentFactory.Krypton.Ribbon.DesignTimeDraw.DrawArea C# (CSharp) Méthode

DrawArea() public static méthode

Draw a design area with a flap on the left hand edge.
public static DrawArea ( KryptonRibbon ribbon, RenderContext context, Rectangle clientRect, PaletteState state ) : void
ribbon KryptonRibbon Reference to owning ribbon control.
context ComponentFactory.Krypton.Toolkit.RenderContext Rendering context.
clientRect System.Drawing.Rectangle Client rectangle of the source view.
state PaletteState State of element.
Résultat void
        public static void DrawArea(KryptonRibbon ribbon,
                                    RenderContext context,
                                    Rectangle clientRect,
                                    PaletteState state)
        {
            Color c;

            if (state == PaletteState.Normal)
                c = ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorDark(PaletteState.Normal);
            else
                c = ribbon.StateCommon.RibbonGroupButton.Back.GetBackColor1(PaletteState.Tracking);

            // Draw entire area in color
            using (SolidBrush darkBrush = new SolidBrush(c))
                context.Graphics.FillRectangle(darkBrush, clientRect);
        }

Usage Example

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            // Ensure the child text view has same state as us
            this[0].ElementState = ElementState;

            // Draw background using the design time colors
            DesignTimeDraw.DrawArea(_ribbon, context, ClientRectangle, State);

            base.RenderBefore(context);
        }