/// <summary> /// open constant list for fomula /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConstantSelect_Click(object sender, EventArgs e) { try { using (var dialog = new frmTagSettingConstant()) { if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (dialog.SelectedConstant != null) { this.calcTextbox.Focus(); this.calcTextbox.SelectionStart = this.textInputPosition; if (this.calcTextbox == txtCalc2) { this.calcTextbox.Paste(string.Format("@C{0}[{1}]", dialog.SelectedNo, dialog.SelectedConstant.NameJ)); } else { this.calcTextbox.Text = string.Format("@C{0}[{1}]", dialog.SelectedNo, dialog.SelectedConstant.NameJ); } dirtyFlag = true; } } } } catch (Exception ex) { ShowErrorMessage(ex); } }
/// <summary> /// open constant list for edit /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConstantAdd_Click(object sender, EventArgs e) { try { using (var dialog = new frmTagSettingConstant() { Mode = frmTagSettingConstant.CONSTANTMODE.Update }) { if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { PutLog("Save ConstantSetting.xml"); } } } catch (Exception ex) { ShowErrorMessage(ex); } }