using System; namespace Microsoft.Windows.Forms { partial class UIControl { private string m_Name; /// /// 获取或设置控件名称 /// public string Name { get { return this.m_Name; } set { this.m_Name = value; } } private bool m_Visible = 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; /// /// 获取或设置控件是否启用 /// public bool Enabled { get { return this.m_Enabled; } set { if (value != this.m_Enabled) { this.m_Enabled = value; this.Invalidate(); } } } private bool m_Capture; /// /// 获取或设置控件是否捕获鼠标 /// 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; } } }