private void MIStockStat_Click(object sender, EventArgs e) { FrmStockStat frmStockStat = new FrmStockStat(); //try //{ FormTools formTools = new FormTools(); formTools.showFrom(this, frmStockStat); //} //catch //{ //} }
static void SetState(Index win, bool bAlertIn, bool bAlertOut) { if (win.InvokeRequired == false) { if (bAlertIn || bAlertOut) { win.oNotify.Visible = true; FrmStockStat frmStockStat = null; frmStockStat = (from child in win.MdiChildren.OfType <FrmStockStat>() select child).FirstOrDefault(); if (frmStockStat == null) { frmStockStat = new FrmStockStat(); FormTools formTools = new FormTools(); formTools.showFrom(win, frmStockStat); } else { frmStockStat.Activate(); } if (bAlertIn) { frmStockStat.rbtnMaterial.Checked = true; } else if (bAlertOut) { frmStockStat.rbtnProduct.Checked = true; } win.oNotify.ShowBalloonTip(1000 * 10, "温馨提示", "账面库存小于最低库存量,请注意!!!", System.Windows.Forms.ToolTipIcon.Info); } else { win.oNotify.Visible = false; } } else { win.Invoke(new Action <Index, bool, bool>(SetState), new object[] { win, bAlertIn, bAlertOut }); } }