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 IntelligentControlForsx.Service.WindturbineControl.Domain; namespace IntelligentControlForsx.MyControls.windturbine { public partial class LabelName : UserControl { public LabelName() { InitializeComponent(); } private string lblName; public string LblName { set { lblName = value; lblNameString.Text = value; } get { return lblName; } } private bool warningValue; public bool WarningValue { set { if (value) { lblNameString.ForeColor = Color.FromArgb(255, 128, 0); } else { lblNameString.ForeColor = Color.FromArgb(255, 255, 255); } warningValue = value; } get { return warningValue; } } public event EventHandler MyClick; private void lblWindturbineName_Click(object sender, EventArgs e) { if (!this.DesignMode) { Label lable = (Label)sender; MyClick(this.Name, e); } } } }