Exemple #1
0
        public MainForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // Initialize tabbed MDI manager
            //
            tabbedMDIManager = new Syncfusion.Windows.Forms.Tools.TabbedMDIManager();
            tabbedMDIManager.AttachToMdiContainer(this);
        }
Exemple #2
0
        public Form1()
        {
            InitializeComponent();
            this.MinimumSize = this.Size;
            try
            {
                System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid1.ico"));
                this.Icon = ico;
            }
            catch { }

            //adding TabbedMDI Manager
            this.tabbedMDIManager                       = new Syncfusion.Windows.Forms.Tools.TabbedMDIManager();
            this.tabbedMDIManager.AttachedTo            = this;
            this.tabbedMDIManager.DropDownButtonVisible = true;
            this.tabbedMDIManager.ImageSize             = new System.Drawing.Size(16, 16);
            this.tabbedMDIManager.NeedUpdateHostedForm  = false;
            this.tabbedMDIManager.TabStyle              = typeof(Syncfusion.Windows.Forms.Tools.TabRendererOffice2016Colorful);
            this.tabbedMDIManager.BeforeDropDownPopup  += new Syncfusion.Windows.Forms.Tools.DropDownPopupEventHandler(this.BeforePopup);
            this.tabbedMDIManager.TabControlAdded      += new Syncfusion.Windows.Forms.Tools.TabbedMDITabControlEventHandler(this.tabbedMDIManager_TabControlAdded);
            // Trigger when right clicking on the tabs.
            this.tabbedMDIManager.ContextMenuItem.BeforePopup += new CancelEventHandler(ContextMenuItem_BeforePopup);
            this.propertyGrid1.SelectedObject = (object)this.tabbedMDIManager;
            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);

            this.NewDocClick(this, EventArgs.Empty);
            this.NewDocClick(this, EventArgs.Empty);
            this.NewDocClick(this, EventArgs.Empty);
            this.NewDocClick(this, EventArgs.Empty);

            // Turn on MDI Tabbed Documents mode.
            // Call this after loading the mdi children to restore their previous state.
            this.TabbedMDIOn = true;
            this.tabbedMDIManager.ContextMenuItem.Items.Add(this.closeAllContextMenuItem);
            this.tabbedMDIManager.ContextMenuItem.BeginGroupAt(closeAllContextMenuItem);
            this.tabbedMDIManager.ContextMenuItem.Items.Add(this.newDocumentContextMenuItem);
            this.tabbedMDIManager.ThemeName = "Office2019Colorful";

            if (File.Exists(@"..\..\persist.xml"))
            {
                AppStateSerializer serializer = new AppStateSerializer(SerializeMode.XMLFile, @"..\..\persist");
                this.tabbedMDIManager.LoadTabGroupStates(serializer);
                SendMessageToStatusBar("TabGroupStates loaded");
            }
        }