/// <summary> /// 设置子窗体样式 /// </summary> private void SetChildWindowLookAndFeel() { foreach (KeyValuePair <string, Form> pair in m_FormList) { FrameBaseFunction.Frm列表窗体模板 frm = (FrameBaseFunction.Frm列表窗体模板)pair.Value; frm.SetLookAndFeel(myLF.LookAndFeel); } }
/// <summary> /// 创建Form实例。 /// </summary> /// <param name="formName">Form的类名</param> public void CreateFormInstance(string proFunNO, string sText) { try { string proNameSpace, clsFormName; DataView dv = new DataView(); dv.Table = dtMdiMainTree; dv.RowFilter = "fchrFrmNameID='" + proFunNO + "'"; proNameSpace = dv.ToTable().Rows[0]["fchrNameSpace"].ToString().Trim(); bool flag = false; clsFormName = proFunNO; for (int i = 0; i < this.MdiChildren.Length; i++) { if (this.MdiChildren[i].Tag.ToString().ToLower() == proFunNO.ToLower()) { frmBase = (FrameBaseFunction.Frm列表窗体模板) this.MdiChildren[i]; this.MdiChildren[i].Activate(); flag = true; frmBase.ControlBox = false; break; } } if (!flag) { FrameBaseFunction.ClsDistributeForm clsDistributeForm = new FrameBaseFunction.ClsDistributeForm(); frmBase = (FrameBaseFunction.Frm列表窗体模板)clsDistributeForm.DistributeForm(proNameSpace, clsFormName); frmBase.Tag = proFunNO.ToString(); frmBase.Text = sText.Trim(); frmBase.MdiParent = this; frmBase.WindowState = FormWindowState.Maximized; frmBase.ControlBox = false; frmBase.Show(); } } catch (Exception ee) { MessageBox.Show("该功能尚未提供!" + ee.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void xtraTabbedMdiManager2_SelectedPageChanged(object sender, EventArgs e) { try { if (this.ActiveMdiChild == null) { return; } frmBase = (FrameBaseFunction.Frm列表窗体模板) this.ActiveMdiChild; bindingSource1.DataSource = frmBase.dtBind; lbActForm.Caption = "当前窗体:" + frmBase.Text + "\t"; frmBase.WindowState = FormWindowState.Normal; } catch (Exception ee) { MessageBox.Show("出现错误!\n\n\t错误信息如下:\n\t" + ee.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }