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