如图,我想通过按下是来清除主窗口的数字。
希望指教啊,谢谢~

解决方案 »

  1.   

    可以用 监听 订阅 和 broadcast   3  5行代码搞定  哈哈
      

  2.   

    判断这个弹窗的返回值
    if(messagebox.show()=dialogresult.yes)
      

  3.   

    if(messagebox.show()=dialogresult.yes)
      

  4.   

    根本不需要使用子窗体,主窗体的删除按钮代码:        private void button1_Click(object sender, EventArgs e)
            {
                DialogResult result = MessageBox.Show("是否删除数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    textBox1.Text = string.Empty;
                    textBox2.Text = string.Empty;
                    textBox3.Text = string.Empty;
                }
            }