You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

42 lines
969 B

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();
}
}
}
}