tangxu
2025-02-26 2fc64c1af548596c4719d4a3abdc10de7a1d7e8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#region Imports
 
using System.Drawing;
using System.Windows.Forms;
using static DPumpHydr.WinFrmUI.RLT.Helper.CrownHelper;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Controls
{
    #region CrownSeparator
 
    public class CrownSeparator : Control
    {
        #region Constructor Region
 
        public CrownSeparator()
        {
            SetStyle(ControlStyles.Selectable, false);
 
            Dock = DockStyle.Top;
            Size = new(1, 2);
        }
 
        #endregion
 
        #region Paint Region
 
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
 
            using (Pen p = new(ThemeProvider.Theme.Colors.DarkBorder))
            {
                g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0);
            }
 
            using (Pen p = new(ThemeProvider.Theme.Colors.LightBorder))
            {
                g.DrawLine(p, ClientRectangle.Left, 1, ClientRectangle.Right, 1);
            }
        }
 
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            // Absorb event
        }
 
        #endregion
    }
 
    #endregion
}