private void ApplyColors(Control parent) { foreach (Control control in parent.Controls) { if (control is FlatTabControl) { FlatTabControl tabView = control as FlatTabControl; tabView.UpdateColors(); // TabControls embedded in plugins probably do not use the main background color. // If that is required we have to reach through to those specific places and fix that individually. //tabView.BackgroundColor = Conversions.GetApplicationColor(ApplicationColor.AppColorMainBackground, false); } else if (control is HeaderPanel) { HeaderPanel panel = control as HeaderPanel; panel.HeaderColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeader, false); panel.ForeColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeader, true); panel.HeaderColorFocused = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeaderFocused, false); panel.ForeColorFocused = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeaderFocused, true); } else if (control is ToolStrip) { ToolStrip toolStrip = control as ToolStrip; toolStrip.BackColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelToolbar, false); toolStrip.ForeColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelToolbar, true); } else if (control is TabPage) { TabPage page = control as TabPage; if (page.Parent is FlatTabControl) { FlatTabControl view = page.Parent as FlatTabControl; if (view.TabStyle == FlatTabControl.TabStyleType.BottomNormal) { page.BackColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelContentArea, false); } } } if (control.ContextMenuStrip != null) { if (Conversions.UseWin8Drawing()) { control.ContextMenuStrip.Renderer = new Win8MenuStripRenderer(); } else { control.ContextMenuStrip.Renderer = new TransparentMenuStripRenderer(); } } ApplyColors(control); } }
private void ApplyColors(Control parent) { foreach (Control control in parent.Controls) { if (control is FlatTabControl) { FlatTabControl tabView = control as FlatTabControl; tabView.UpdateColors(); tabView.BackgroundColor = Conversions.GetApplicationColor(ApplicationColor.AppColorMainBackground, false); } else if (control is HeaderPanel) { HeaderPanel panel = control as HeaderPanel; panel.HeaderColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeader, false); panel.ForeColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeader, true); panel.HeaderColorFocused = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeaderFocused, false); panel.ForeColorFocused = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelHeaderFocused, true); } else if (control is ToolStrip) { ToolStrip toolStrip = control as ToolStrip; toolStrip.BackColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelToolbar, false); toolStrip.ForeColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelToolbar, true); } else if (control is TabPage) { TabPage page = control as TabPage; if (page.Parent is FlatTabControl) { FlatTabControl view = page.Parent as FlatTabControl; if (view.TabStyle == FlatTabControl.TabStyleType.BottomNormal) { page.BackColor = Conversions.GetApplicationColor(ApplicationColor.AppColorPanelContentArea, false); } } } ApplyColors(control); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); this.listViewSysInfo = new UtilityLibrary.WinControls.ListViewEx(); this.tabControl1 = new FlatTabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.okButton = new XPButton(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.SuspendLayout(); // // propertyGrid1 // this.propertyGrid1.CommandsVisibleIfAvailable = true; this.propertyGrid1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.propertyGrid1.LargeButtons = false; this.propertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar; this.propertyGrid1.Location = new System.Drawing.Point(8, 8); this.propertyGrid1.Name = "propertyGrid1"; this.propertyGrid1.Size = new System.Drawing.Size(483, 278); this.propertyGrid1.TabIndex = 0; this.propertyGrid1.TabStop = false; this.propertyGrid1.Text = "propertyGrid1"; this.propertyGrid1.ToolbarVisible = false; this.propertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window; this.propertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText; // // listViewSysInfo // this.listViewSysInfo.CheckBookEvenRowBackColor = System.Drawing.Color.Empty; this.listViewSysInfo.CheckBookEvenRowForeColor = System.Drawing.Color.Empty; this.listViewSysInfo.CheckBookLookEnabled = false; this.listViewSysInfo.CheckBookOddRowBackColor = System.Drawing.Color.Empty; this.listViewSysInfo.CheckBookOddRowForeColor = System.Drawing.Color.Empty; this.listViewSysInfo.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.listViewSysInfo.FullRowSelect = true; this.listViewSysInfo.HeaderColor = System.Drawing.Color.Empty; this.listViewSysInfo.HeaderImageList = null; this.listViewSysInfo.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.listViewSysInfo.Location = new System.Drawing.Point(8, 8); this.listViewSysInfo.Name = "listViewSysInfo"; this.listViewSysInfo.PaintSortedColumnBackground = true; this.listViewSysInfo.Size = new System.Drawing.Size(482, 272); this.listViewSysInfo.SortingEnabled = true; this.listViewSysInfo.SortOrder = System.Windows.Forms.SortOrder.Ascending; this.listViewSysInfo.TabIndex = 0; this.listViewSysInfo.TabStop = false; this.listViewSysInfo.View = System.Windows.Forms.View.Details; // // tabControl1 // this.tabControl1.BorderDarkColor = System.Drawing.SystemColors.ControlDarkDark; this.tabControl1.BorderLightColor = System.Drawing.SystemColors.ControlDark; this.tabControl1.ControlBackColor = System.Drawing.SystemColors.Control; this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Location = new System.Drawing.Point(8, 8); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(504, 320); this.tabControl1.TabAlignment = FlatTabControl.FlatTabAlignment.Top; this.tabControl1.TabIndex = 2; this.tabControl1.TextColor = System.Drawing.SystemColors.ControlText; // // tabPage1 // this.tabPage1.Controls.Add(this.propertyGrid1); this.tabPage1.Location = new System.Drawing.Point(4, 25); this.tabPage1.Name = "tabPage1"; this.tabPage1.Size = new System.Drawing.Size(496, 291); this.tabPage1.TabIndex = 0; this.tabPage1.Text = " Information "; // // tabPage2 // this.tabPage2.Controls.Add(this.listViewSysInfo); this.tabPage2.Location = new System.Drawing.Point(4, 25); this.tabPage2.Name = "tabPage2"; this.tabPage2.Size = new System.Drawing.Size(496, 291); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Loaded Assemblies"; // // okButton // this.okButton.AdjustImageLocation = new System.Drawing.Point(0, 0); this.okButton.BtnShape = emunType.BtnShape.Rectangle; this.okButton.BtnStyle = emunType.XPStyle.Silver; this.okButton.ImageIndex = 0; this.okButton.Location = new System.Drawing.Point(440, 336); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 28); this.okButton.TabIndex = 42; this.okButton.Text = "OK"; this.okButton.Click += new System.EventHandler(this.okButton_Click); // // linkLabel1 // this.linkLabel1.Location = new System.Drawing.Point(8, 344); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(128, 24); this.linkLabel1.TabIndex = 43; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "System Information"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // // ApplicationInfoDialog // this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); this.ClientSize = new System.Drawing.Size(522, 372); this.Controls.Add(this.linkLabel1); this.Controls.Add(this.okButton); this.Controls.Add(this.tabControl1); this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ApplicationInfoDialog"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Application Information"; this.Load += new System.EventHandler(this.Form1_Load); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.ResumeLayout(false); }