private void onClick(object sender, System.EventArgs e) { FormulaEditorForm f = new FormulaEditorForm(variables, sub, symbols); if (formulaString != null) { f.Formula = formulaString; } Form form = null; Control c = this; while (true) { if (c is Form) { form = c as Form; break; } c = c.Parent; } f.ShowDialog(form); if (!f.Accepted) { return; } Formula = f.Formula; Refresh(); }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { var formula = value == null ? string.Empty : (string)value; var dlg = new FormulaEditorForm(formula); return(dlg.ShowDialog() == DialogResult.OK ? dlg.Formula : value); }
public void ShowFormulaEditor() { FormulaEditorForm formulaEditorForm = new FormulaEditorForm(this, this.EvaporationAndDryingSystem); formulaEditorForm.ShowDialog(); }