Ejemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics  g    = e.Graphics;
            Rectangle rect = ClientRectangle;

            SkinFormRenderer renderer = Renderer;

            renderer.DrawSkinFormBackground(
                new SkinFormBackgroundRenderEventArgs(
                    this, g, rect));
            renderer.DrawSkinFormCaption(
                new SkinFormCaptionRenderEventArgs(
                    this, g, CaptionRect, _active));
            renderer.DrawSkinFormBorder(
                new SkinFormBorderRenderEventArgs(
                    this, g, rect, _active));

            if (ControlBoxManager.CloseBoxVisibale)
            {
                renderer.DrawSkinFormControlBox(
                    new SkinFormControlBoxRenderEventArgs(
                        this,
                        g,
                        ControlBoxManager.CloseBoxRect,
                        _active,
                        ControlBoxStyle.Close,
                        ControlBoxManager.CloseBoxState));
            }

            if (ControlBoxManager.MaximizeBoxVisibale)
            {
                renderer.DrawSkinFormControlBox(
                    new SkinFormControlBoxRenderEventArgs(
                        this,
                        g,
                        ControlBoxManager.MaximizeBoxRect,
                        _active,
                        ControlBoxStyle.Maximize,
                        ControlBoxManager.MaximizeBoxState));
            }

            if (ControlBoxManager.MinimizeBoxVisibale)
            {
                renderer.DrawSkinFormControlBox(
                    new SkinFormControlBoxRenderEventArgs(
                        this,
                        g,
                        ControlBoxManager.MinimizeBoxRect,
                        _active,
                        ControlBoxStyle.Minimize,
                        ControlBoxManager.MinimizeBoxState));
            }
        }
Ejemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                if (_controlBoxManager != null)
                {
                    _controlBoxManager.Dispose();
                    _controlBoxManager = null;
                }

                _renderer = null;
                _toolTip.Dispose();
            }
        }