57 lines
1.2 KiB
C#
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
|
|
}
|
|
}
|