private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*"; if (ofd.ShowDialog() == DialogResult.OK) //если в окне была нажата кнопка "ОК" { try { frmChild frm = new frmChild(); frm.MdiParent = this; frm.Text = (forname).ToString(); frm.Show(); Bitmap image = new Bitmap(ofd.FileName); frm.pictureBox1.Size = image.Size; frm.pictureBox1.Image = image; frm.pictureBox1.Invalidate(); Filename = ofd.FileName; forname++; } catch { DialogResult rezult = MessageBox.Show("Unable to open the image", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void clearToolStripMenuItem_Click(object sender, EventArgs e) { Program.fc.Close(); frmChild frm = new frmChild(); frm.MdiParent = this; frm.Show(); }
private void createToolStripMenuItem_Click(object sender, EventArgs e) { frmChild frm = new frmChild(); frm.MdiParent = this; frm.Text = (forname).ToString(); frm.Show(); forname++; }