You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Controls/Mesnac.Controls.Default/SpecialButton1.cs

69 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Reflection;
using System.IO;
using Mesnac.Controls.Base;
namespace Mesnac.Controls.Default
{
[ToolboxBitmap(typeof(SpecialButton1), "Resources.SpecialButton1.png")]
public partial class SpecialButton1 : Button
{
#region 字段定义
protected Assembly _assembly = Assembly.GetExecutingAssembly();
protected Stream _imageStream;
private List<DesignAction> _clickActionList = new List<DesignAction>();
#endregion
#region 构造方法
public SpecialButton1()
{
InitializeComponent();
this.Size = new Size(136, 60);
this.BackColor = Color.Transparent; //背景透明
this.FlatStyle = System.Windows.Forms.FlatStyle.Flat; //显示样式
this.FlatAppearance.BorderSize = 0; //边框为0
this.FlatAppearance.MouseOverBackColor = Color.Transparent;
this.FlatAppearance.MouseDownBackColor = Color.Transparent;
this.TextAlign = ContentAlignment.MiddleCenter; //文字对齐
this.Font = new System.Drawing.Font("黑体", 12, FontStyle.Bold); //设置字体
this.ForeColor = Color.White; //文字颜色
_imageStream = _assembly.GetManifestResourceStream("Mesnac.Controls.Default.Resources.SpecialButton1.png");
this.BackgroundImage = Image.FromStream(_imageStream);
this.BackgroundImageLayout = ImageLayout.Stretch;
}
public SpecialButton1(IContainer container)
{
container.Add(this);
InitializeComponent();
}
#endregion
#region 事件属性Click
public List<DesignAction> ClickActionList
{
get
{
return this._clickActionList;
}
set
{
this._clickActionList = value;
}
}
#endregion
}
}