MDI formlarda Child Formların Bir Kereye Mahsus Açılması

Mdi formlarda child formaları 1 kere açmak için :

    Form2 mChild;

    private void optionsToolStripMenuItem_Click(object sender, EventArgs e) {
      if (mChild == null) {
        mChild = new Form2();
        mChild.MdiParent = this;
        mChild.FormClosed += new FormClosedEventHandler(mChild_FormClosed);
      }
      mChild.WindowState = FormWindowState.Normal;
      mChild.Show();
    }

    void mChild_FormClosed(object sender, FormClosedEventArgs e) {
      mChild = null;
    }

Leave a Reply