private void button_ok_Click(object sender, EventArgs e) { string val = this.textBox_value.Text.Trim(); if (String.IsNullOrWhiteSpace(val))//基础检测 { FormUtil.ShowNotEmptyMessageBox(); return; } //else if (String.Equals(currentVal, initValue)) //{ // FormUtil.ShowWarningMessageBox("与初始内容相同,如果不用修改,请取消。" + currentVal); // return; //} else { //检查输入 foreach (string notbe in canNotBeValues) { if (notbe == val) { FormUtil.ShowWarningMessageBox(canNotBeMsg + val); return; } } InputValue = val; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }
private void button_ok_Click(object sender, EventArgs e) { string val = this.textBox_value.Text.Trim(); if (val == "")//基础检测 { FormUtil.ShowNotEmptyMessageBox(); return; } else { Lines = this.textBox_value.Lines; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }