using DevExpress.XtraEditors; using System; using System.Windows.Forms; namespace HL_FristAidPlatform_PreHospitalEmergency { public partial class Form_MissionAbort : XtraForm { public Form_MissionAbort() { InitializeComponent(); } public delegate void TextEventHandler(string strText); public TextEventHandler TextHandler; private void simpleButton1_Click(object sender, EventArgs e) { if (null != TextHandler) { TextHandler.Invoke(textEdit1.Text); DialogResult = DialogResult.OK; } } private void textEdit1_KeyPress(object sender, KeyPressEventArgs e) { if (Keys.Enter == (Keys)e.KeyChar) { if (null != TextHandler) { if (string.IsNullOrEmpty(textEdit1.Text)) { MessageBox.Show("原因不能为空"); return; } TextHandler.Invoke(textEdit1.Text); DialogResult = DialogResult.OK; } } } private void simpleButton2_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; } } }