TableBorder.cs 1.1 KB

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