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.

149 lines
3.9 KiB
C#

1 year ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Mesnac.Controls.Default
{
[ToolboxBitmap(typeof(System.Windows.Forms.Label))]
public partial class CombinedLabel : UserControl
{
public CombinedLabel()
{
InitializeComponent();
this.ForeColor = this.Label1.ForeColor;
}
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
this.Label1.ForeColor = value;
this.Label2.ForeColor = value;
this.Label3.ForeColor = value;
this.Label4.ForeColor = value;
this.Label5.ForeColor = value;
this.ReplaceLabel1.ForeColor = value;
}
}
protected bool _bHaveAction;
/// <summary>
/// 是否有动画
/// </summary>
public bool bHaveAction
{
get
{
return _bHaveAction;
}
set
{
_bHaveAction = value;
}
}
/// <summary>
/// 状态表达式
/// </summary>
[Description("状态表达式"), Category("Data")]
public string StatusReplaceExpress
{
get { return this.ReplaceLabel1.ReplaceExpress; }
set { this.ReplaceLabel1.ReplaceExpress = value; }
}
/// <summary>
/// 完成数格式
/// </summary>
[Description("完成数格式"), Category("Data")]
public string CompleteNumFormat
{
get { return this.Label4.Format; }
set { this.Label4.Format = value; }
}
/// <summary>
/// 重量格式
/// </summary>
[Description("重量格式"), Category("Data")]
public string WeightFormat
{
get { return this.Label5.Format; }
set { this.Label5.Format = value; }
}
/// <summary>
/// 状态动画属性
/// </summary>
public string StatusName
{
get { return this.ReplaceLabel1.TextName; }
set { this.ReplaceLabel1.TextName = value; }
}
/// <summary>
/// 完成数动画属性
/// </summary>
public string CompleteNumName
{
get { return this.Label4.TextName; }
set { this.Label4.TextName = value; }
}
/// <summary>
/// 重量动画属性
/// </summary>
public string WeightName
{
get { return this.Label5.TextName; }
set { this.Label5.TextName = value; }
}
/// <summary>
/// 状态
/// </summary>
public string Status
{
get { return this.ReplaceLabel1.TextValue; }
set { this.ReplaceLabel1.TextValue = value; }
}
/// <summary>
/// 完成数
/// </summary>
public string CompleteNum
{
get { return this.Label4.TextValue; }
set
{
this.Label4.TextValue = value;
if (String.IsNullOrEmpty(value) || value == "0")
{
this.Visible = false;
}
else
{
this.Visible = true;
}
}
}
/// <summary>
/// 重量
/// </summary>
public string Weight
{
get { return this.Label5.TextValue; }
set { this.Label5.TextValue = value; }
}
private void CombinedLabel_Resize(object sender, EventArgs e)
{
this.Size = new Size(90, 48);
}
}
}