Files
VisionEdit/UsingControl/Controls/CButton.cs
liu.wenjie a24dda2525 1、优化LOG显示与引用
2、添加PMA工具,工具内容待完善
3、修复流程树显示
4、添加开源项目,优化UI空间
5、其他BUG更改
2021-11-23 15:51:37 +08:00

68 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public delegate void DClicked();
public partial class CButton : UserControl
{
public CButton()
{
InitializeComponent();
btn_button.Text = TextStr;
}
/// <summary>
/// 点击事件
/// </summary>
public event DClicked Clicked;
/// <summary>
/// 文本
/// </summary>
private string _textStr = "Button";
public string TextStr
{
get { return _textStr; }
set
{
_textStr = value;
btn_button.Text = value;
}
}
private void btn_button_MouseEnter(object sender, EventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonEnter;
Application.DoEvents();
}
private void btn_button_MouseDown(object sender, MouseEventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonDown;
Application.DoEvents();
}
private void btn_button_MouseLeave(object sender, EventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonUp;
Application.DoEvents();
}
private void btn_button_MouseUp(object sender, MouseEventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonUp;
Application.DoEvents();
}
private void btn_button_Click(object sender, EventArgs e)
{
if (Clicked != null)
Clicked();
}
}
}