Files
VAR.DatabaseExplorer/ServerExplorer/Controls/WindowButton.cs
2017-01-27 11:20:39 +01:00

57 lines
1.2 KiB
C#

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
}
}