DataGridViewStatisticsCount.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace LYFZ.ComponentLibrary
  10. {
  11. public partial class DataGridViewStatisticsCount : UserControl
  12. {
  13. public DataGridViewStatisticsCount()
  14. {
  15. InitializeComponent();
  16. }
  17. private int _LocationX = 1;
  18. /// <summary>
  19. /// 显示的X坐标
  20. /// </summary>
  21. public int LocationX
  22. {
  23. get { return _LocationX; }
  24. set
  25. {
  26. _LocationX = value;
  27. this.labelEx1.Location = new Point(LocationX, this.labelEx1.Location.Y);
  28. }
  29. }
  30. private string _StrUnit = "单";
  31. /// <summary>
  32. /// 单位
  33. /// </summary>
  34. [Bindable(false)]
  35. public string StrUnit
  36. {
  37. get { return _StrUnit; }
  38. set { _StrUnit = value; }
  39. }
  40. private int _CurrenQuantity = 0;
  41. /// <summary>
  42. /// 当前数量
  43. /// </summary>
  44. public int CurrenQuantity
  45. {
  46. get { return _CurrenQuantity; }
  47. set { _CurrenQuantity = value; }
  48. }
  49. private int _TotalQuantity = 0;
  50. /// <summary>
  51. /// 总数量
  52. /// </summary>
  53. public int TotalQuantity
  54. {
  55. get { return _TotalQuantity; }
  56. set
  57. {
  58. _TotalQuantity = value;
  59. this.labelEx1.Text = "当前显示 " + this.CurrenQuantity + " " + this.StrUnit + " / 共 " + this.TotalQuantity + " " + this.StrUnit + "";
  60. }
  61. }
  62. }
  63. }