添加项目文件。

This commit is contained in:
dengzhihao
2024-10-28 14:29:58 +08:00
commit ecf5f95e36
222 changed files with 688156 additions and 0 deletions

34
C-Windows-1/MyGroupBox.cs Normal file
View File

@@ -0,0 +1,34 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace C_Windows_1
{
public partial class MyGroupBox : GroupBox //Component
{
public MyGroupBox()
{
InitializeComponent();
}
public MyGroupBox(IContainer container)
{
container.Add(this);
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);
e.Graphics.DrawLine(Pens.DarkSlateGray, 1, vSize.Height / 2, 8, vSize.Height / 2);
e.Graphics.DrawLine(Pens.DarkSlateGray, vSize.Width + 8, vSize.Height / 2, this.Width - 2, vSize.Height / 2);
e.Graphics.DrawLine(Pens.DarkSlateGray, 1, vSize.Height / 2, 1, this.Height - 2);
e.Graphics.DrawLine(Pens.DarkSlateGray, 1, this.Height - 2, this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(Pens.DarkSlateGray, this.Width - 2, vSize.Height / 2, this.Width - 2, this.Height - 2);
}
}
}