tangxu
2024-12-29 72e75456f8b30ec5b6f355539d9c883b0f810d21
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
using System.ComponentModel;
using System.Drawing;
 
namespace Microsoft.Windows.Forms
{
    partial class UIControl
    {
        private string m_Text = "";
        /// <summary>
        /// 获取或设置文本
        /// </summary>
        [Category("外观"), Description("获取或设置文本")]
        [DefaultValue("")]
        public virtual string Text
        {
            get
            {
                return this.m_Text;
            }
            set
            {
                if (value != this.m_Text)
                {
                    this.m_Text = value;
                    this.Invalidate();
                }
            }
        }
 
        private Font m_Font = DefaultTheme.Font;
        /// <summary>
        /// 获取或设置字体
        /// </summary>
        [Category("外观"), Description("获取或设置字体")]
        [DefaultValue(typeof(Font),"微软雅黑,9pt")]
        public virtual Font Font
        {
            get
            {
                return this.m_Font;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");
                if (value != this.m_Font)
                {
                    this.m_Font = value;
                    this.Invalidate();
                }
            }
        }
 
        private Color m_BackColor = DefaultTheme.BackColor;
        /// <summary>
        /// 获取或设置背景色
        /// </summary>
        [Category("外观"), Description("获取或设置背景色")]
        [DefaultValue(typeof(Color), "45,45,45")]
        public virtual Color BackColor
        {
            get
            {
                return this.m_BackColor;
            }
            set
            {
                if (value != this.m_BackColor)
                {
                    this.m_BackColor = value;
                    this.Invalidate();
                }
            }
        }
 
        private Color m_ForeColor = DefaultTheme.ForeColor;
        /// <summary>
        /// 获取或设置前景色
        /// </summary>
        [Category("外观"), Description("获取或设置前景色")]
        [DefaultValue(typeof(Color), "210,210,210")]
        public virtual Color ForeColor
        {
            get
            {
                return this.m_ForeColor;
            }
            set
            {
                if (value != this.m_ForeColor)
                {
                    this.m_ForeColor = value;
                    this.Invalidate();
                }
            }
        }
 
        private State m_State;
        /// <summary>
        /// 获取状态
        /// </summary>
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public virtual State State
        {
            get
            {
                return this.m_State;
            }
            protected set
            {
                if (value != this.m_State)
                {
                    this.m_State = value;
                    this.Invalidate();
                }
            }
        }
 
        /// <summary>
        /// 计算状态
        /// </summary>
        /// <returns>状态</returns>
        protected virtual State GetState()
        {
            return this.Enabled ? State.Normal : State.Disabled;
        }
    }
}