private void EnterRemoveSize_FormClosed(object sender, FormClosedEventArgs e) { FormEnterValue enterValue = (FormEnterValue)sender; if (enterValue.DialogResult == DialogResult.OK) { float smallerThanSize = (float)enterValue.Value; entityBox1.RemoveSmallWires(smallerThanSize); } }
private void removeSmallWiresToolStripMenuItem_Click(object sender, EventArgs e) { int wireCount = entityBox1.GetWireCount(); if (wireCount == 0) { MessageBox.Show("No wires!"); return; } FormEnterValue enterValue = new FormEnterValue("Remove wires smaller than (lambda):"); enterValue.FormClosed += EnterRemoveSize_FormClosed; enterValue.ShowDialog(); }