ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace HotelPms.Share.Windows.Component
{
    public class GradientLabel : Label
    {
        private LinearGradientMode m_GradientMode = LinearGradientMode.Horizontal;
        [Description("EndBackColor"), Category("CTextBoxArray動作")]
        public LinearGradientMode GradientMode
        {
            get { return m_GradientMode; }
            set { m_GradientMode = value; this.Invalidate(); }
        }
 
 
        private Color m_EndBackColor = Color.FromArgb(120, 150, 150);
 
        [Description("EndBackColor"), Category("CTextBoxArray動作")]
        public Color EndBackColor
        {
            get { return m_EndBackColor; }
            set { m_EndBackColor = value; this.Invalidate(); }
        }
 
        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            base.OnPaintBackground(pevent);
 
            //BackColor Color.FromArgb(0, 64, 64)
            using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, BackColor, m_EndBackColor, m_GradientMode))
            {
                pevent.Graphics.FillRectangle(brush, this.ClientRectangle);
            }
        }
    }
}