⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grouppanel.cs

📁 Fireball.CodeEditor is an source code editor control derived from the best compona SyntaxBox Control
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

using Fireball.Drawing.Shapes;

namespace Fireball.Windows.Forms
{
    public class GroupPanel:Control
    {
        private ShapeRoundRectangle _shape;
        private Color _fillColor;
        private Color _borderColor;

        public GroupPanel()
        {
            _shape = new ShapeRoundRectangle(new Rectangle(0,0, 100,100), 6);

            _fillColor = Color.Transparent;
            _borderColor = SystemColors.ControlDark;

            _shape.Pen = new Pen(_borderColor);
            _shape.Brush = new SolidBrush(_fillColor);
        }

        public Color FillColor
        {
            get
            {
                return _fillColor;
            }
            set
            {
                _fillColor = value;
                _shape.Brush = new SolidBrush(_fillColor);
                this.Invalidate();
            }
        }

        public Color BorderColor
        {
            get
            {
                return _borderColor;
            }
            set
            {
                _borderColor = value;
                _shape.Pen = new Pen(_borderColor);
                this.Invalidate();
            }
        }

        protected override void OnSizeChanged(EventArgs e)
        {
            _shape.Width = this.ClientRectangle.Width-1;
            _shape.Height = this.ClientRectangle.Height-1;

            base.OnSizeChanged(e);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            _shape.Draw(e.Graphics,System.Drawing.Drawing2D.SmoothingMode.AntiAlias);

            base.OnPaint(e);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -