LightPlate.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.ComponentModel;
  2. using System.Windows.Forms;
  3. namespace IntelligentControlForsx
  4. {
  5. public partial class LightPlate : UserControl
  6. {
  7. public LightPlate()
  8. {
  9. InitializeComponent();
  10. }
  11. private LightPlateModel lpModel;
  12. public LightPlateModel getLightPlateModel()
  13. {
  14. return lpModel;
  15. }
  16. public void setLightPlateModel(LightPlateModel model)
  17. {
  18. lpModel = model;
  19. if (lpModel != null)
  20. {
  21. //lblTitle.Text = lpModel.LName;
  22. if (lpModel.LCount < 100)
  23. {
  24. lblCount.Location = new System.Drawing.Point(71,32);
  25. } else if (lpModel.LCount< 1000)
  26. {
  27. lblCount.Location = new System.Drawing.Point(66, 32);
  28. } else
  29. {
  30. lblCount.Location = new System.Drawing.Point(60, 32);
  31. }
  32. lblCount.Text = lpModel.LCount + "";
  33. if (lpModel.LRank == 5)
  34. {
  35. this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌01;
  36. }
  37. else if (lpModel.LRank == 4)
  38. {
  39. this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌03;
  40. }
  41. else
  42. {
  43. this.BackgroundImage = global::IntelligentControlForsx.Properties.Resources.光字牌02;
  44. }
  45. this.BackColor = lpModel.getBackColor();
  46. } else
  47. {
  48. //lblTitle.Text = "";
  49. lblCount.Location = new System.Drawing.Point(71, 32);
  50. lblCount.Text = "0";
  51. // this.BackColor = Color.White;
  52. }
  53. }
  54. public void clear()
  55. {
  56. lblCount.Text = "";
  57. //this.BackColor = Color.White;
  58. }
  59. private string ltitle;
  60. private string lid;
  61. [Browsable(true)]
  62. public string LTitle
  63. {
  64. get
  65. {
  66. return ltitle;
  67. }
  68. set
  69. {
  70. ltitle = value;
  71. lblTitle.Text = ltitle;
  72. }
  73. }
  74. [Browsable(true)]
  75. public string LID
  76. {
  77. get
  78. {
  79. return lid;
  80. }
  81. set
  82. {
  83. lid = value;
  84. }
  85. }
  86. }
  87. }