using System; using System.Drawing; using System.Windows.Forms; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.Misc; using Infragistics.Win.UltraWinEditors; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.LgCommon { public partial class frmStyleBase : FrmBase { protected Color _BACKCOLOR = Color.FromArgb(255, 183, 208, 250); protected Color _BACKCOLOR2 = Color.FromArgb(255, 213, 228, 242); protected Color _color3 = Color.FromArgb(255, 218, 232, 248); public frmStyleBase() { InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); SetControlStyle(this); // ClsControlPack.SetUltraGridAppearance(this); } private void SetControlAppearance(Control ctrl) { try { if (ClsControlPack.SpecificType(ctrl, typeof(Form))) ctrl.BackColor = _BACKCOLOR; else if (ctrl.GetType().Equals(typeof(Panel))) ctrl.BackColor = _BACKCOLOR; else if (ctrl.GetType().Equals(typeof(GroupBox))) ctrl.BackColor = _BACKCOLOR; else if (ctrl.GetType().Equals(typeof(ToolStrip))) ctrl.BackColor = _BACKCOLOR; else if (ClsControlPack.SpecificType(ctrl, typeof(Label))) ctrl.BackColor = _BACKCOLOR; else if (ClsControlPack.SpecificType(ctrl, typeof(UserControl))) ctrl.BackColor = _BACKCOLOR; if (ClsControlPack.SpecificType(ctrl, typeof(ControlBase)) && !ClsControlPack.SpecificType(ctrl, typeof(EditorButtonControlBase))) ((ControlBase)ctrl).Appearance.BackColor = _BACKCOLOR; else if (ClsControlPack.SpecificType(ctrl, typeof(UltraGroupBox))) { ((UltraGroupBox)ctrl).ViewStyle = GroupBoxViewStyle.Default; ((UltraGroupBox)ctrl).HeaderBorderStyle = UIElementBorderStyle.RaisedSoft; ((UltraGroupBox)ctrl).BorderStyle = GroupBoxBorderStyle.Rectangular3D; ((UltraGroupBox)ctrl).Appearance.BackColor = _BACKCOLOR2; ((UltraGroupBox)ctrl).Appearance.BackColor2 = _BACKCOLOR2; } else if (ClsControlPack.SpecificType(ctrl, typeof(UltraPanel))) ((UltraPanel)ctrl).Appearance.BackColor = _BACKCOLOR; else if (ClsControlPack.SpecificType(ctrl, typeof(UltraGrid))) { ((UltraGrid) ctrl).DisplayLayout.Override.HeaderAppearance.BackColor = _BACKCOLOR; ((UltraGrid)ctrl).DisplayLayout.Appearance.BackColor = _color3; ((UltraGrid)ctrl).DisplayLayout.Appearance.BackColor2 = _color3; } else if (ClsControlPack.SpecificType(ctrl, typeof(UltraExpandableGroupBox))) ( (UltraExpandableGroupBox)ctrl).ViewStyle = GroupBoxViewStyle.Office2007; } catch { } } private void SetControlStyle(Control parentCtrl) { try { SetControlAppearance(parentCtrl); foreach (Control ctrl in parentCtrl.Controls) { SetControlStyle(ctrl); } } catch { } } } }