public Form1() { // // Required for Windows Form Designer support // Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); InitializeComponent(); this.MinimumSize = this.Size; this.mainFrameBarManager1.MainMenuBar.DrawBackground += new PaintEventHandler(MainMenuBar_DrawBackground); this.bar1.DrawBackground += new PaintEventHandler(bar1_DrawBackground); this.bar2.DrawBackground += new PaintEventHandler(bar2_DrawBackground); this.StartPosition = FormStartPosition.CenterScreen; this.tabbedMDIManager = new TabbedMDIManager(); this.tabbedMDIManager.AttachToMdiContainer(this); this.tabbedMDIManager.TabStyle = typeof(TabRendererMetro); this.tabbedMDIManager.ContextMenuItem.Style = Syncfusion.Windows.Forms.VisualStyle.Metro; string targetPath = Application.StartupPath + "\\" + "de-DE"; string sourceFile = System.IO.Path.GetFullPath("..\\..\\de-DE\\Syncfusion.Tools.Windows.resources.dll"); if (!System.IO.Directory.Exists(targetPath)) { System.IO.Directory.CreateDirectory(targetPath); System.IO.File.Copy(sourceFile, targetPath + "\\Syncfusion.Tools.Windows.resources.dll"); sourceFile = System.IO.Path.GetFullPath("..\\..\\de-DE\\Syncfusion.Shared.Base.resources.dll"); System.IO.File.Copy(sourceFile, targetPath + "\\Syncfusion.Shared.Base.resources.dll"); sourceFile = System.IO.Path.GetFullPath("..\\..\\de-DE\\run.bat"); System.IO.File.Copy(sourceFile, targetPath + "\\run.bat"); } try { System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid.ico")); this.Icon = ico; } catch { } }
/// <summary> /// Occurs before a form is displayed for the first time. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The event data with information about the type.</param> private void Form1_Load(object sender, EventArgs e) { this.dockingManager1.DockControl(this.toolbox, this, DockingStyle.Left, 100); this.dockingManager1.DockControl(this.solutionExplorer, this, DockingStyle.Right, 150); this.dockingManager1.DockControl(this.teamExplorer, this, DockingStyle.Top, 175); this.dockingManager1.DockControl(this.serverExplorer, this.teamExplorer, DockingStyle.Left, 175); this.dockingManager1.DockControl(this.properties, this.teamExplorer, DockingStyle.Right, 175); this.dockingManager1.EnableDocumentMode = true; this.dockingManager1.DockAsDocument(this.startPage); this.startPage.BackColor = Color.White; this.dockingManager1.DockControl(this.findResults, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 125); this.dockingManager1.DockControl(this.errorList, this.properties, Syncfusion.Windows.Forms.Tools.DockingStyle.Bottom, 175); int height = (int)((this.toolbox.Height / 3) * (1.5)); this.dockingManager1.SetControlSize(this.toolbox, new Size(this.Width / 5, this.Height)); this.dockingManager1.SetControlSize(this.solutionExplorer, new Size(this.Width / 5, this.Height)); this.dockingManager1.SetControlSize(this.teamExplorer, new Size(this.Width / 5, height)); this.dockingManager1.SetControlSize(this.serverExplorer, new Size(this.Width / 5, height)); this.dockingManager1.SetControlSize(this.properties, new Size(this.Width / 5, height)); this.dockingManager1.SetControlSize(this.errorList, new Size(this.Width / 5, (this.properties.Height / 2))); this.dockingManager1.SetControlSize(this.startPage, new Size(this.teamExplorer.Width + this.serverExplorer.Width, this.toolbox.Height / 3)); this.dockingManager1.SetControlSize(this.findResults, new Size(this.properties.Width, this.toolbox.Height / 3)); this.dockingManager1.DockStateChanging += DockingManager1_DockStateChanging; this.dockingManager1.DockContextMenu += DockingManager1_DockContextMenu; foreach (Control control in dockingManager1.ControlsArray) { if (control != null && control.HasChildren && control.Controls != null && control.Controls.Count > 0 && control.Controls.Count == 1 && control.Controls[0] is Label) { Label label = ((control.Controls[0]) as Label); label.ForeColor = ColorTranslator.FromHtml("#6d6d6d"); label.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); label.Padding = new Padding(0, 30, 0, 0); label.TextAlign = ContentAlignment.MiddleCenter; UpdateCaptionCustomization(control, label); } } if (dockingManager1.GetType() != null) { PropertyInfo property = dockingManager1.GetType().GetProperty("DocumentContainer", BindingFlags.Instance | BindingFlags.NonPublic); if (property != null) { var source = property.GetValue(dockingManager1, null); if (source != null) { TabbedMDIManager documentContainer = (TabbedMDIManager)source; if (documentContainer != null && documentContainer.TabGroupHosts != null) { foreach (TabHost tabHost in documentContainer.TabGroupHosts) { if (tabHost != null && tabHost.MDITabPanel != null) { TabControlAdv tabControl = tabHost.MDITabPanel as TabControlAdv; if (tabControl != null) { tabControl.ShowTabCloseButton = false; } } } if (documentContainer.ContextMenuItem != null) { documentContainer.ContextMenuItem.BeforePopup += ContextMenuItem_BeforePopup; } } } } } }