ShowNumber.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. namespace LYFZ.ComponentLibrary
  7. {
  8. public class ShowNumber : System.Windows.Forms.Panel
  9. {
  10. public ShowNumber()
  11. {
  12. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._1_01;
  13. this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
  14. this.Width = 27;
  15. this.Height = 26;
  16. this.BackColor = System.Drawing.Color.Transparent;
  17. }
  18. int number = 1;
  19. /// <summary>
  20. ///
  21. /// </summary>
  22. [DescriptionAttribute("设置当前显示数字1-10"), CategoryAttribute("组件扩展属性")]
  23. public int Number
  24. {
  25. get { return number; }
  26. set
  27. {
  28. if (value >= 0 && value <= 10)
  29. {
  30. number = value;
  31. switch (Number)
  32. {
  33. case 1:
  34. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._1_01;
  35. break;
  36. case 2:
  37. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._2_01;
  38. break;
  39. case 3:
  40. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._3_01;
  41. break;
  42. case 4:
  43. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._4_01;
  44. break;
  45. case 5:
  46. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._5_01;
  47. break;
  48. case 6:
  49. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._6_01;
  50. break;
  51. case 7:
  52. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._7_01;
  53. break;
  54. case 8:
  55. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._8_01;
  56. break;
  57. case 9:
  58. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._9_01;
  59. break;
  60. case 10:
  61. this.BackgroundImage = LYFZ.ComponentLibrary.GetUIResources._10_01;
  62. break;
  63. }
  64. Invalidate(false);
  65. }
  66. }
  67. }
  68. }
  69. }