添加项目文件。

This commit is contained in:
Administrator
2026-08-04 18:36:40 +08:00
parent 16fb9e4f5a
commit a2ecbc795d
616 changed files with 149853 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace JinYuan.ControlLib
{
public partial class GroupBoxEX : GroupBox
{
private Color mBorderColor = Color.FromArgb(1, 146, 235);
[Browsable(true), Description("边框颜色"), Category("自定义分组")]
public Color BorderColor
{
get { return mBorderColor; }
set { mBorderColor = value; }
}
public GroupBoxEX()
{
InitializeComponent();
}
// 重写
protected override void OnPaint(PaintEventArgs e)
{
var vSize = e.Graphics.MeasureString(this.Text, this.Font);
e.Graphics.Clear(this.BackColor);
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), 10, 1);
Pen vPen = new Pen(this.mBorderColor); // 用属性颜色来画边框颜色
e.Graphics.DrawLine(vPen, 1, vSize.Height / 2, 8, vSize.Height / 2);
e.Graphics.DrawLine(vPen, vSize.Width + 8, vSize.Height / 2, this.Width - 2, vSize.Height / 2);
e.Graphics.DrawLine(vPen, 1, vSize.Height / 2, 1, this.Height - 2);
e.Graphics.DrawLine(vPen, 1, this.Height - 2, this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(vPen, this.Width - 2, vSize.Height / 2, this.Width - 2, this.Height - 2);
}
}
}