TextAngleButtonItem.cs 958 B

123456789101112131415161718192021222324252627282930313233343536
  1. using FastReport.DevComponents.DotNetBar;
  2. using System;
  3. using System.Windows.Forms;
  4. namespace FastReport.Controls
  5. {
  6. internal class TextAngleButtonItem : ButtonItem
  7. {
  8. private ControlContainerItem host;
  9. private AngleControl control;
  10. public int Angle
  11. {
  12. get => control.Angle;
  13. set => control.Angle = value;
  14. }
  15. public event EventHandler AngleChanged;
  16. public TextAngleButtonItem()
  17. {
  18. AutoExpandOnClick = true;
  19. PopupType = ePopupType.ToolBar;
  20. control = new AngleControl();
  21. control.AngleChanged += (s, e) => AngleChanged?.Invoke(this, e);
  22. host = new ControlContainerItem();
  23. host.Control = control;
  24. SubItems.Add(host);
  25. this.PopupOpen += (s, e) =>
  26. {
  27. control.UpdateDpiDependencies(ContainerControl as Control);
  28. };
  29. }
  30. }
  31. }