private void btn_Sinottico_Click(object sender, EventArgs e) { var f1 = typeof(Control).GetField("EventClick", BindingFlags.Static | BindingFlags.NonPublic); var obj = f1.GetValue(pbReload); var pi = pbReload.GetType().GetProperty("Events", BindingFlags.NonPublic | BindingFlags.Instance); var list = (EventHandlerList)pi.GetValue(pbReload, null); list.RemoveHandler(obj, list[obj]); SuspendLayout(); foreach (Form frm in MdiChildren) { frm.Hide(); } ResumeLayout(true); Sinottico f = new Sinottico() { MdiParent = this }; f.WindowState = FormWindowState.Maximized; f.Show(); //history[numOfOpenedForms++] = f; }
private void btnSinottico_Click(object sender, EventArgs e) { LoadingInfo.InfoText = "Loading exacta production..."; LoadingInfo.ShowLoading(); btnBack.Enabled = true; //var f1 = typeof(Control).GetField("EventClick", BindingFlags.Static | BindingFlags.NonPublic); //var obj = f1.GetValue(pbReload); //var pi = pbReload.GetType().GetProperty("Events", BindingFlags.NonPublic | BindingFlags.Instance); //var list = (EventHandlerList)pi.GetValue(pbReload, null); //list.RemoveHandler(obj, list[obj]); SuspendLayout(); foreach (Form frm in MdiChildren) { frm.Hide(); } ResumeLayout(true); Sinottico f = new Sinottico() { MdiParent = this }; Sinottico.Mode = "Sinottico_Production"; f.WindowState = FormWindowState.Maximized; f.Show(); if (!firstTimeClicked && history[currentPosition + 1] != null) { btnForward.Enabled = false; numOfOpenedForms = currentPosition + 1; history[numOfOpenedForms++] = f; for (var i = numOfOpenedForms; i < history.Count() - 1; i++) { history[i] = null; } } else { history[numOfOpenedForms++] = f; } currentPosition = numOfOpenedForms - 1; LoadingInfo.CloseLoading(); }
private void btn_Exacta_Click(object sender, EventArgs e) { LoadingInfo.InfoText = "Loading exacta efficiency..."; LoadingInfo.ShowLoading(); btnBack.Enabled = true; SuspendLayout(); foreach (Form frm in MdiChildren) { frm.Hide(); } ResumeLayout(true); Sinottico f = new Sinottico() { MdiParent = this }; Sinottico.Mode = "Sinottico_Efficiency"; //f.GetColorByEfficiency(); f.WindowState = FormWindowState.Maximized; f.Show(); if (!firstTimeClicked && history[currentPosition + 1] != null) { btnForward.Enabled = false; numOfOpenedForms = currentPosition + 1; history[numOfOpenedForms++] = f; for (var i = numOfOpenedForms; i < history.Count() - 1; i++) { history[i] = null; } } else { history[numOfOpenedForms++] = f; } currentPosition = numOfOpenedForms - 1; LoadingInfo.CloseLoading(); }