using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace FacOneZPStation { public partial class FrmPass : Form { public event Action OkBtnClick; public FrmPass() { InitializeComponent(); } private void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtPass.Text)) { MessageBox.Show("请输入密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); txtPass.Focus(); return; } if (OkBtnClick != null) { OkBtnClick(txtPass.Text); } } private void btnCancel_Click(object sender, EventArgs e) { this.Close(); } } }