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
#region Imports
 
using System.Drawing;
using System.Windows.Forms;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Controls
{
    #region Separator
 
    public class Separator : Control
    {
        #region Properties
 
        private Color _LineColor = Color.Gray;
        public Color LineColor
        {
            get => _LineColor;
            set
            {
                _LineColor = value;
                Invalidate();
            }
        }
 
        #endregion
 
        public Separator()
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            Size = new(120, 10);
        }
 
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.DrawLine(new(LineColor), 0, 5, Width, 5);
        }
    }
 
    #endregion
}