private void extButtonHighValue_Click(object sender, EventArgs e) { ExtendedControls.ConfigurableForm cf = new ConfigurableForm(); int width = 300; int height = 100; cf.Add(new ExtendedControls.ConfigurableForm.Entry("UC", typeof(ExtendedControls.NumberBoxLong), panelStars.SystemDisplay.ValueLimit.ToStringInvariant(), new Point(5, 30), new Size(width - 5 - 20, 24), null) { numberboxlongminimum = 1, numberboxlongmaximum = 2000000000 }); cf.Add(new ExtendedControls.ConfigurableForm.Entry("OK", typeof(ExtendedControls.ExtButton), "OK".T(EDTx.OK), new Point(width - 20 - 80, height - 40), new Size(80, 24), "")); cf.Trigger += (dialogname, controlname, tag) => { System.Diagnostics.Debug.WriteLine("control" + controlname); if (controlname.Contains("Validity:False")) { cf.GetControl("OK").Enabled = false; } else if (controlname.Contains("Validity:True")) { cf.GetControl("OK").Enabled = true; } else if (controlname == "OK") { cf.ReturnResult(DialogResult.OK); } else if (controlname == "Cancel") { cf.ReturnResult(DialogResult.Cancel); } }; if (cf.ShowDialogCentred(this.FindForm(), this.FindForm().Icon, "Set Valuable Minimum".T(EDTx.UserControlScan_VLMT)) == DialogResult.OK) { long?value = cf.GetLong("UC"); panelStars.SystemDisplay.ValueLimit = (int)value.Value; PutSetting("ValueLimit", panelStars.SystemDisplay.ValueLimit); DrawSystem(); } }