public void paramOK_Click(object sender, EventArgs e) { try { BSFX bsfx = new BSFX(); bsfx.lotSizeBox.Text = lotSizeBoxParam.Text.ToString(); this.Invoke(new MethodInvoker(delegate { bsfx.lotSizeBox.Text = lotSizeBoxParam.Text.ToString(); })); this.Invoke(new MethodInvoker(delegate { bsfx.maxPosBox.Text = maxPosBoxParam.Text; })); this.Invoke(new MethodInvoker(delegate { bsfx.maxSpreadBox.Text = maxSpreadBoxParam.Text; })); this.Invoke(new MethodInvoker(delegate { bsfx.moveBox.Text = moveBoxParam.Text; })); this.Invoke(new MethodInvoker(delegate { bsfx.goalBox.Text = goalBoxParam.Text; })); this.Invoke(new MethodInvoker(delegate { bsfx.stopLossBox.Text = stopLossBoxParam.Text; })); this.Invoke(new MethodInvoker(delegate { bsfx.intervalBox.Text = intervalBoxParam.Text; })); bsfx.Update(); this.Close(); } catch (Exception updateErr) { Console.WriteLine(updateErr); } }