private void 生产ToolStripMenuItem_Click(object sender, EventArgs e) { CloseForm(); Control frm; if (!dictform.ContainsKey("MoMForm")) { this.Cursor = Cursors.WaitCursor; DataTable data = sqlSelectTable.GetMom(); frm = new ChildrenForm(data); var client = frm as ChildrenForm; client.SetScrDataGrid(); client.CellDouble += new CellDoubleClickHandler((col, dr) => { this.Cursor = Cursors.WaitCursor; if (dr[col] != null && !dr["项目编码"].Equals("")) { data = sqlSelectTable.GetMom_moallocate(dr["项目编码"].ToString()); } DataShow children = new DataShow(data); children.Show(); this.Cursor = Cursors.Default; }); dictform.Add("MoMForm", frm); this.Cursor = Cursors.Default; } else { frm = dictform["MoMForm"]; } OpenForm(frm); }
public void AddChild(ChildrenForm form) { if (this.ActiveMdiChild != null) { this.ActiveMdiChild.Close(); } form.WindowState = FormWindowState.Maximized; form.MdiParent = this; this.SuspendLayout(); form.Show(); this.ResumeLayout(); RefreshToolBar(); this.PerformLayout(); }
private void 库存ToolStripMenuItem_Click(object sender, EventArgs e) { CloseForm(); Control frm; if (!dictform.ContainsKey("InvForm")) { this.Cursor = Cursors.WaitCursor; DataTable data = sqlSelectTable.GetWarehouse(); frm = new ChildrenForm(data); var client = frm as ChildrenForm; client.SetScrDataGrid(); dictform.Add("InvForm", frm); this.Cursor = Cursors.Default; } else { frm = dictform["InvForm"]; } OpenForm(frm); }
public void RefreshToolBar() { this.toolstrip.SuspendLayout(); this.toolstrip.Items.Clear(); ChildrenForm children = (ChildrenForm)this.ActiveMdiChild; if (children != null) { ToolBarCommand[] commands = children.GetCommands(); if (commands != null) { foreach (ToolBarCommand command in commands) { ToolStripButton tsb = ToolStripButtonBuilder.BuildToolStripButton(command); tsb.Click += new EventHandler(tsb_Click); this.toolstrip.Items.Add(tsb); } } } this.toolstrip.ResumeLayout(); }