예제 #1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                if (_mmcControlBoxManager != null)
                {
                    _mmcControlBoxManager.Dispose();
                    _mmcControlBoxManager = null;
                }

                _renderer = null;
                _toolTip.Dispose();
            }
        }
예제 #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics  g    = e.Graphics;
            Rectangle rect = ClientRectangle;

            FormRenderer renderer = Renderer;

            renderer.DrawGroundFormBackground(new FormBackgroundRenderEventArgs(this, g, rect));
            renderer.DrawGroundFormCaption(new FormCaptionRenderEventArgs(this, g, CaptionRect, _isActive));
            renderer.DrawGroundFormBorder(new FormBorderRenderEventArgs(this, g, rect, _isActive));

            if (MmcControlBoxManager.IsCloseBoxVisibale)
            {
                renderer.DrawGroundFormControlBox(
                    new FormControlBoxRenderEventArgs(
                        this,
                        g,
                        MmcControlBoxManager.CloseBoxRect,
                        _isActive,
                        ControlBoxStyle.Close,
                        MmcControlBoxManager.CloseBoxState));
            }

            if (MmcControlBoxManager.IsMaximizeBoxVisibale)
            {
                renderer.DrawGroundFormControlBox(
                    new FormControlBoxRenderEventArgs(
                        this,
                        g,
                        MmcControlBoxManager.MaximizeBoxRect,
                        _isActive,
                        ControlBoxStyle.Maximize,
                        MmcControlBoxManager.MaximizeBoxState));
            }

            if (MmcControlBoxManager.IsMinimizeBoxVisibale)
            {
                renderer.DrawGroundFormControlBox(
                    new FormControlBoxRenderEventArgs(
                        this,
                        g,
                        MmcControlBoxManager.MinimizeBoxRect,
                        _isActive,
                        ControlBoxStyle.Minimize,
                        MmcControlBoxManager.MinimizeBoxState));
            }
        }