using System.ComponentModel; namespace UAS_MES_NEW.CustomControl.ValueLabel { public partial class ValueNumLabel : System.Windows.Forms.Label { public ValueNumLabel() { InitializeComponent(); } /// /// 防止返回空值转换时出错 /// public override string Text { get { if (base.Text == "") { return "0"; } return base.Text; } set { base.Text = value; } } public ValueNumLabel(IContainer container) { container.Add(this); InitializeComponent(); } } }