using System; using System.ComponentModel; namespace Microsoft.Windows.Forms { partial class UIControl { private string m_Name = ""; /// /// 获取或设置控件名称 /// [Category("设计"), Description("获取或设置控件名称")] [DefaultValue("")] public string Name { get { return this.m_Name; } set { this.m_Name = value; } } private bool m_Visible = true; /// /// 获取或设置控件是否可见 /// [Category("设计"), Description("获取或设置控件是否可见")] [DefaultValue(true)] public bool Visible { get { return this.m_Visible; } set { if (value != this.m_Visible) { this.m_Visible = value; this.SetBounds(); this.Invalidate(); } } } private bool m_Enabled = true; /// /// 获取或设置控件是否启用 /// [Category("行为"), Description("获取或设置控件是否启用")] [DefaultValue(true)] public bool Enabled { get { return this.m_Enabled; } set { if (value != this.m_Enabled) { this.m_Enabled = value; this.Invalidate(); } } } private bool m_Capture; /// /// 获取或设置控件是否捕获鼠标 /// [Category("行为"), Description("获取或设置控件是否捕获鼠标")] [DefaultValue(false)] public bool Capture { get { return this.m_Capture; } set { if (value != this.Capture) { this.m_Capture = value; this.State = this.GetState(); if (value) this.OnEnter(EventArgs.Empty); else this.OnLeave(EventArgs.Empty); } } } /// /// 显示控件 /// public void Show() { this.Visible = true; } /// /// 隐藏控件 /// public void Hide() { this.Visible = false; } } }