TableBorder.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. namespace FastReport.FastQueryBuilder
  6. {
  7. internal enum BorderPosition
  8. {
  9. None,
  10. Right,
  11. Bottom,
  12. Left,
  13. Top
  14. }
  15. internal class TableBorder
  16. {
  17. private UserControl table;
  18. private BorderPosition border;
  19. public bool isResize;
  20. private void SetCursor()
  21. {
  22. table.Cursor = Cursors.Default;
  23. switch (border)
  24. {
  25. case BorderPosition.Top:
  26. case BorderPosition.Bottom:
  27. table.Cursor = Cursors.SizeNS;
  28. break;
  29. case BorderPosition.Left:
  30. case BorderPosition.Right:
  31. table.Cursor = Cursors.SizeWE;
  32. break;
  33. }
  34. }
  35. public TableBorder(UserControl tbl)
  36. {
  37. table = tbl;
  38. }
  39. public BorderPosition SelectedBorder
  40. {
  41. get
  42. {
  43. return border;
  44. }
  45. set
  46. {
  47. border = value;
  48. SetCursor();
  49. }
  50. }
  51. }
  52. }