TabbedViewExtension.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using DevExpress.XtraBars.Docking2010.Views;
  2. using DevExpress.XtraBars.Docking2010;
  3. using DevExpress.XtraBars.Docking2010.Views.Tabbed;
  4. using DevExpress.XtraEditors;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Drawing;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace ExtensionsDev
  13. {
  14. public static class TabbedViewExtension
  15. {
  16. public static void UseDefault(this TabbedView tabbedView1)
  17. {
  18. tabbedView1.DocumentProperties.AllowFloat = false;
  19. tabbedView1.DocumentProperties.AllowFloatOnDoubleClick = false;
  20. tabbedView1.DocumentProperties.AllowDock = false;
  21. tabbedView1.DocumentProperties.AllowDockFill = false;
  22. tabbedView1.DocumentProperties.AllowTabReordering = false;
  23. tabbedView1.DocumentProperties.ShowPinButton = false;
  24. //tabbedView1.DocumentGroupProperties.ShowTabHeader = false;
  25. tabbedView1.DocumentClosed += TabbedView1_DocumentClosed;
  26. tabbedView1.PopupMenuShowing += TabbedView1_PopupMenuShowing;
  27. }
  28. private static void TabbedView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
  29. {
  30. e.Cancel = true;
  31. }
  32. private static void TabbedView1_DocumentClosed(object sender, DocumentEventArgs e)
  33. {
  34. e.Document.Dispose();
  35. (sender as TabbedView).Manager.View.Documents.Remove(e.Document);
  36. }
  37. }
  38. }