public frmMain() { InitializeComponent(); ribbonControl1.ShowPageHeadersMode = ShowPageHeadersMode.Hide; UpdateMainUI(); string title = INISystemConfig.GetTitle(); if (!String.IsNullOrEmpty(title)) { this.Text = title; } PageHeadColor = new XtraTabbedMdiManagerPageColor(); bll = new bllModules(); MDIPageOption(); if (INISystemConfig.GetWindowState() == "Y") { this.WindowState = FormWindowState.Maximized; } new GZFramework.UI.Dev.RibbonButton.RibbonLoad(rpage_Option, rpg_Function, rpg_DataNav); //设置皮肤 SkinTools.InitSkinAStyleGallery(ribbonGalleryBarItem1, ribbonControl1, barItem_RbStyle); this.FormClosing += frmMain_FormClosing; }
void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (this.WindowState == FormWindowState.Maximized) { INISystemConfig.SetWindowState("Y"); } else { INISystemConfig.SetWindowState(""); } }
private void MDIPageOptionBool_EditValueChanged(object sender, ItemClickEventArgs e) { BarCheckItem bci = (sender as BarCheckItem); bool check = bci.Checked; string tag = ConvertLib.ToString(bci.Tag); DefaultBoolean boolean = check == true ? DefaultBoolean.True : DefaultBoolean.False; switch (tag) { case "TabFloatOnDoubleClick": { xtraTabbedMdiManager1.FloatOnDoubleClick = boolean; }; break; case "TabFloatOnDrag": { xtraTabbedMdiManager1.FloatOnDrag = boolean; }; break; case "TabColored": { if (check) { PageHeadColor.BoundChildPagesBackColor(xtraTabbedMdiManager1); } else { PageHeadColor.UnBoundChildPagesBackColor(xtraTabbedMdiManager1); } }; break; case "TabHeaderAutoFill": { xtraTabbedMdiManager1.HeaderAutoFill = boolean; }; break; } INISystemConfig.SetTabStrValue(tag, check); }
/* * // 设置当前 tab页的 图标,我这里也默认取navBar中的Item中的图标 * xtraTabbedMdiManager1.Pages[frm].Image = Image.FromHbitmap(frm.Icon.ToBitmap().GetHbitmap()); */ private void MDIPageOptionEmun_EditValueChanged(object sender, EventArgs e) { BarEditItem bei = (sender as BarEditItem); string text = ""; string tag = ConvertLib.ToString(bei.Tag); switch (tag) { case "TabPageImagePosition": { text = ((TabPageImagePosition)bei.EditValue).ToString(); xtraTabbedMdiManager1.PageImagePosition = (TabPageImagePosition)bei.EditValue; }; break; case "ClosePageButtonShowMode": { text = ((ClosePageButtonShowMode)bei.EditValue).ToString(); xtraTabbedMdiManager1.ClosePageButtonShowMode = (ClosePageButtonShowMode)bei.EditValue; }; break; case "TabHeaderLocation": { text = ((TabHeaderLocation)bei.EditValue).ToString(); xtraTabbedMdiManager1.HeaderLocation = (TabHeaderLocation)bei.EditValue; }; break; case "TabOrientation": { text = ((TabOrientation)bei.EditValue).ToString(); xtraTabbedMdiManager1.HeaderOrientation = (TabOrientation)bei.EditValue; }; break; } INISystemConfig.SetTabStrValue(tag, text); }
//设置用户配置 void MDIPageOption() { cmb_PageImagePosition.Items.AddEnum(typeof(TabPageImagePosition)); cmb_ClosePageButton.Items.AddEnum(typeof(ClosePageButtonShowMode)); cmb_HeaderLocation.Items.AddEnum(typeof(TabHeaderLocation)); cmb_HeaderOrientation.Items.AddEnum(typeof(TabOrientation)); bei_PageImagePosition.Tag = "TabPageImagePosition"; bei_ClosePageButton.Tag = "ClosePageButtonShowMode"; bei_HeaderLocation.Tag = "TabHeaderLocation"; bei_HeaderOrientation.Tag = "TabOrientation"; //绑定值改变事件 bei_PageImagePosition.EditValueChanged += MDIPageOptionEmun_EditValueChanged; bei_ClosePageButton.EditValueChanged += MDIPageOptionEmun_EditValueChanged; bei_HeaderLocation.EditValueChanged += MDIPageOptionEmun_EditValueChanged; bei_HeaderOrientation.EditValueChanged += MDIPageOptionEmun_EditValueChanged; string val = ""; val = INISystemConfig.GetTabPageImagePosition(); if (val != "") { bei_PageImagePosition.EditValue = (TabPageImagePosition)Enum.Parse(typeof(TabPageImagePosition), val); } val = INISystemConfig.GetTabClosePageButton(); if (val != "") { bei_ClosePageButton.EditValue = (ClosePageButtonShowMode)Enum.Parse(typeof(ClosePageButtonShowMode), val); } val = INISystemConfig.GetTabHeaderLocation(); if (val != "") { bei_HeaderLocation.EditValue = (TabHeaderLocation)Enum.Parse(typeof(TabHeaderLocation), val); } val = INISystemConfig.GetTabHeaderOrientation(); if (val != "") { bei_HeaderOrientation.EditValue = (TabOrientation)Enum.Parse(typeof(TabOrientation), val); } chk_FlatOnDoubleClick.CheckedChanged += MDIPageOptionBool_EditValueChanged; chk_FloatOnDrag.CheckedChanged += MDIPageOptionBool_EditValueChanged; chk_Colored.CheckedChanged += MDIPageOptionBool_EditValueChanged; chk_HeaderAutoFill.CheckedChanged += MDIPageOptionBool_EditValueChanged; chk_FlatOnDoubleClick.Tag = "TabFloatOnDoubleClick"; chk_FloatOnDrag.Tag = "TabFloatOnDrag"; chk_Colored.Tag = "TabColored"; chk_HeaderAutoFill.Tag = "TabHeaderAutoFill"; chk_FlatOnDoubleClick.Checked = INISystemConfig.GetTabFloatOnDoubleClick(); chk_FloatOnDrag.Checked = INISystemConfig.GetTabFloatOnDrag(); chk_Colored.Checked = INISystemConfig.GetTabColored(); chk_HeaderAutoFill.Checked = INISystemConfig.GetTabHeaderAutoFill(); }
protected override void DoSave(object sender) { INISystemConfig.SetTitle(txt_title.Text); GZFramework.UI.Dev.Common.Msg.ShowInformation("保存成功!"); }
private void frmSetting_Load(object sender, EventArgs e) { txt_title.Text = INISystemConfig.GetTitle(); }