123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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;
- }
- }
- }
- }
|