+ -
当前位置:首页 → 问答吧 → show().和ShowDialog()有什么区别。为什么这个事件只能在SHOW里用?

show().和ShowDialog()有什么区别。为什么这个事件只能在SHOW里用?

时间:2011-12-25

来源:互联网

C# code

        private void btnAdd_Click(object sender, EventArgs e)
        {
            //禁用当前窗口
            this.Enabled = false;
            frmAdd add = new frmAdd();
            add.Show();

           add.FormClosing += new FormClosingEventHandler(add_FormClosing);
        }

        private void add_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Enabled = true;
            this.bind();
        }


add.show 就正常
换成add.showdialog就不能用了哦.....

作者: x1937   发布时间: 2011-12-25

ShowDialog方法是模式窗体显示,典型的例子如VS中添加项目窗口,添加文件窗口
Show方法是非模式窗体显示,典型的例子如VS中的查找窗口。

作者: wuyq11   发布时间: 2011-12-25

楼上回答正确

作者: liyangfd   发布时间: 2011-12-25