private void hardDriveToolStripMenuItem_Click(object sender, EventArgs e) { if (hardDrivePeripheralForm == null) { hardDrivePeripheralForm = new HardDrivePeripheralForm(); // Set the parent form of the child window. hardDrivePeripheralForm.MdiParent = this; // Display the new form. hardDrivePeripheralForm.Text = "Hard Drive"; hardDrivePeripheralForm.FormClosing += Close_FormHD; } hardDrivePeripheralForm.Show(); }
public void Close_FormHD(object sender, EventArgs e) { hardDrivePeripheralForm.Stop_Thread(); hardDrivePeripheralForm = null; }