private void button2_Click(object sender, EventArgs e) { var ea = new MyBoxEvent(); ea.text = textBox1.Text; ea.bCanel = true; this.onClose.Invoke(this, ea); this.Close(); }
private void button1_Click(object sender, EventArgs e) { var ea = new MyBoxEvent(); ea.text = textBox1.Text; ea.bCanel = false; if (string.IsNullOrEmpty(ea.text)) { MessageBox.Show("输入个名字吧!"); } if (this.onClose != null) { this.onClose.Invoke(this, ea); } this.Close(); }