using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WinFormControl.Properties;
|
|
|
|
namespace WinFormControl
|
|
{
|
|
public class UButton : Button
|
|
{
|
|
protected override void InitLayout()
|
|
{
|
|
base.InitLayout();
|
|
this.BackgroundImage = Resources.simpleBtn;
|
|
this.ForeColor = Color.Black;
|
|
this.BackColor = Color.Transparent;
|
|
this.FlatStyle = FlatStyle.Flat;
|
|
this.FlatAppearance.BorderSize = 0;
|
|
}
|
|
|
|
protected override void OnClick(EventArgs e)
|
|
{
|
|
this.BackgroundImage = Resources.onclickBtn;
|
|
this.ForeColor = Color.White;
|
|
this.Refresh();
|
|
try
|
|
{
|
|
base.OnClick(e);
|
|
}
|
|
finally
|
|
{
|
|
System.Threading.Thread.Sleep(200);
|
|
this.BackgroundImage = Resources.simpleBtn;
|
|
this.ForeColor = Color.Black;
|
|
this.Refresh();
|
|
}
|
|
}
|
|
}
|
|
}
|