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/SpecialButton2.cs

77 lines
2.3 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(SpecialButton2), "Resources.SpecialButton2.png")]
public partial class SpecialButton2 : Button
{
#region 字段定义
protected Assembly _assembly = Assembly.GetExecutingAssembly();
protected Stream _imageStream;
private List<DesignAction> _clickActionList = new List<DesignAction>();
private int _sbvNumber = 0;
public int SbvNumber
{
get { return _sbvNumber; }
set { _sbvNumber = value; }
}
#endregion
#region 构造方法
public SpecialButton2()
{
InitializeComponent();
this.Size = new Size(136, 60);
this.BackColor = Color.Transparent; //背景透明
this.FlatStyle = System.Windows.Forms.FlatStyle.Flat; //显示样式
this.FlatAppearance.BorderSize = 1; //边框为0
this.FlatAppearance.BorderColor = Color.Orange;
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.SpecialButton2.png");
//this.BackgroundImage = Image.FromStream(_imageStream);
//this.BackgroundImageLayout = ImageLayout.Stretch;
}
public SpecialButton2(IContainer container)
{
container.Add(this);
InitializeComponent();
}
#endregion
#region 事件属性Click
public List<DesignAction> ClickActionList
{
get
{
return this._clickActionList;
}
set
{
this._clickActionList = value;
}
}
#endregion
}
}