using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing; namespace ServerExplorer.Controls { public class WindowButton : Button { #region Properties private Form _window = null; public Form Window { get { return _window; } set { _window = value; } } private bool _active = false; public bool Active { get { return _active; } set { _active = value; //Font = active ? fntActive : fntNormal; ForeColor = _active ? Color.Black : Color.Gray; } } #endregion #region Creator public WindowButton() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; Click += WindowButton_Click; } #endregion #region Events void WindowButton_Click(object sender, EventArgs e) { if (_window == null) { return; } _window.Activate(); } #endregion } }