mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2024-10-17 15:26:49 +03:00
45 lines
971 B
C#
45 lines
971 B
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace DarkUI
|
|
{
|
|
public class DarkSeparator : Control
|
|
{
|
|
#region Constructor Region
|
|
|
|
public DarkSeparator()
|
|
{
|
|
SetStyle(ControlStyles.Selectable, false);
|
|
|
|
Dock = DockStyle.Top;
|
|
Size = new Size(1, 2);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Paint Region
|
|
|
|
protected override void OnPaint(PaintEventArgs e)
|
|
{
|
|
var g = e.Graphics;
|
|
|
|
using (var p = new Pen(Colors.DarkBorder))
|
|
{
|
|
g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0);
|
|
}
|
|
|
|
using (var p = new Pen(Colors.LightBorder))
|
|
{
|
|
g.DrawLine(p, ClientRectangle.Left, 1, ClientRectangle.Right, 1);
|
|
}
|
|
}
|
|
|
|
protected override void OnPaintBackground(PaintEventArgs e)
|
|
{
|
|
// Absorb event
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|