using System.ComponentModel; using System.Windows.Forms; namespace IntelligentControlForsx { public partial class LightPlate : UserControl { public LightPlate() { InitializeComponent(); } private LightPlateModel lpModel; public LightPlateModel getLightPlateModel() { return lpModel; } public void setLightPlateModel(LightPlateModel model) { lpModel = model; if (lpModel != null) { //lblTitle.Text = lpModel.LName; if (lpModel.LCount < 100) { lblCount.Location = new System.Drawing.Point(71,32); } else if (lpModel.LCount< 1000) { lblCount.Location = new System.Drawing.Point(66, 32); } else { lblCount.Location = new System.Drawing.Point(60, 32); } lblCount.Text = lpModel.LCount + ""; if (lpModel.LRank == 5) { this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌01; } else if (lpModel.LRank == 4) { this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌03; } else { this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌02; } this.BackColor = lpModel.getBackColor(); } else { //lblTitle.Text = ""; lblCount.Location = new System.Drawing.Point(71, 32); lblCount.Text = "0"; // this.BackColor = Color.White; } } public void clear() { lblCount.Text = ""; //this.BackColor = Color.White; } private string ltitle; private string lid; [Browsable(true)] public string LTitle { get { return ltitle; } set { ltitle = value; lblTitle.Text = ltitle; } } [Browsable(true)] public string LID { get { return lid; } set { lid = value; } } } }