private void ShowImageForm(object sender, EventArgs e)
 {
     if (cfrmImage == null)
     {
         cfrmImage = new frmImage();
     }
     cfrmImage.MdiParent = this;
     cfrmImage.Text      = "Window " + childFormNumber++;
     cfrmImage.Show();
 }
        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter           = "All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
                if (cfrmImage == null)
                {
                    cfrmImage = new frmImage();
                }
                cfrmImage.LoadImageFromFile(FileName);
            }
        }
 public frmNewRect(frmImage formRef)
 {
     InitializeComponent();
     referringForm = formRef;
 }