예제 #1
0
        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();
        }
예제 #2
0
        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();
        }