private void simpleButton1_Click(object sender, EventArgs e) { if (this.MdiChildren.Any(qq => qq.GetType() == typeof(FormAddEditNalaz))) { this.MdiChildren.First(qq => qq.GetType() == typeof(FormAddEditNalaz)).Activate(); } else { FormAddEditNalaz frm = new FormAddEditNalaz(); frm.Text = "Novi nalaz"; frm.MdiParent = Radiologija.Helper.mainforma; frm.Show(); } }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { if (this.MdiChildren.Any(qq => qq.GetType() == typeof(FormAddEditNalaz))) { this.MdiChildren.First(qq => qq.GetType() == typeof(FormAddEditNalaz)).Activate(); } else { FormAddEditNalaz frm = new FormAddEditNalaz(); frm.Text = "Novi nalaz"; frm.MdiParent = this; frm.Show(); } }
private void simpleButton2_Click(object sender, EventArgs e) { var row = (nalaz)gridView1.GetRow(gridView1.FocusedRowHandle); if (this.MdiChildren.Any(qq => qq.GetType() == typeof(FormAddEditNalaz) && qq.Tag.ToString() == row.id_nalaz.ToString())) { this.MdiChildren.First(qq => qq.GetType() == typeof(FormAddEditNalaz) && qq.Tag.ToString() == row.id_nalaz.ToString()).Activate(); } else { FormAddEditNalaz frm = new FormAddEditNalaz(row); frm.Tag = row.id_nalaz.ToString(); frm.Text = String.Format("Nalaz br.{0}, ({1} {2})", row.id_nalaz, row.ime, row.prezime); frm.MdiParent = Radiologija.Helper.mainforma; frm.Show(); } }