private void ProducePreviewWindows() { int tab_count = this.tabControl1.Tabs.Count - 1; preview_panels = new MyPanelEx[tab_count]; for (int i = 0; i < tab_count; i++) { preview_panels[i] = new MyPanelEx(); preview_panels[i].bf_parent = this; preview_panels[i].BackgroundImageLayout = PreviewPanel.BackgroundImageLayout; preview_panels[i].CanvasColor = PreviewPanel.CanvasColor; preview_panels[i].CausesValidation = PreviewPanel.CausesValidation; preview_panels[i].Location = PreviewPanel.Location; preview_panels[i].Name = "PreviewPane" + Convert.ToString(i + 1); preview_panels[i].Size = PreviewPanel.Size; preview_panels[i].Style.Alignment = PreviewPanel.Style.Alignment; preview_panels[i].Style.BackColor1.Alpha = PreviewPanel.Style.BackColor1.Alpha; preview_panels[i].Style.BackColor1.ColorSchemePart = PreviewPanel.Style.BackColor1.ColorSchemePart; preview_panels[i].Style.BackColor2.Alpha = PreviewPanel.Style.BackColor2.Alpha; preview_panels[i].Style.BackColor2.ColorSchemePart = PreviewPanel.Style.BackColor2.ColorSchemePart; preview_panels[i].Style.Border = PreviewPanel.Style.Border; preview_panels[i].Style.BorderColor.ColorSchemePart = PreviewPanel.Style.BorderColor.ColorSchemePart; preview_panels[i].Style.CornerType = PreviewPanel.Style.CornerType; preview_panels[i].Style.ForeColor.ColorSchemePart = PreviewPanel.Style.ForeColor.ColorSchemePart; preview_panels[i].Style.GradientAngle = 90; preview_panels[i].Visible = false; preview_panels[i].Dock = DockStyle.Fill; preview_panels[i].MouseMove += new System.Windows.Forms.MouseEventHandler(this.PreviewPanel_MouseMove); preview_panels[i].DoubleClick += new System.EventHandler(this.PreviewPanel_DoubleClick); preview_panels[i].Resize += new System.EventHandler(this.PreviewPanel_Resize); } this.panelDockContainer2.Controls.AddRange(preview_panels); preview_panels[0].Visible = true; }