private void f_SosEvent(object sender, SosForm.SosEventParams e) { tabControl1.TabPages.Insert(tabControl1.TabCount - 1, new MegaTabPage("Таб " + tabControl1.TabCount.ToString(), tabControl1.Size)); tabControl1.SelectedIndex = tabControl1.TabCount - 2; MegaTabPage panel = tabControl1.SelectedTab as MegaTabPage; if (e.Path == "") panel.AddGraf(e.Bro + " (" + e.Sym + ")"); else panel.AddGrafFast(e.Bro + " (" + e.Sym + ")", e.Path); dataGridView1.Rows.Add(); dataGridView1[0, dataGridView1.Rows.Count - 1].Value = panel.Grafs[panel.Grafs.Count - 1].ToString(); if (panel.Grafs[panel.Grafs.Count - 1].Fictive) dataGridView1.Rows[dataGridView1.Rows.Count - 1].DefaultCellStyle.ForeColor = Color.Gray; else dataGridView1.Rows[dataGridView1.Rows.Count - 1].DefaultCellStyle.ForeColor = panel.Grafs[panel.Grafs.Count - 1].pPen.Color; dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; panel.SelectedDate = e.Date; dateTimePicker1.Value = e.Date; for (int i = 0; i < panel.Grafs[0].pTime.Count; i++) { if (panel.Grafs[0].pTime[i] > e.Time) { panel.PosX = Math.Max(0, i - 6); panel.hScroll.Value = panel.PosX; panel.Redraw(); break; } } }
private void tsSosok_Click(object sender, EventArgs e) { SosForm f = new SosForm(Params); f.SosEvent += new EventHandler<SosForm.SosEventParams>(f_SosEvent); f.Show(); }