实现隐藏窗体而非关闭的方法

时间:2014-03-19 16:44:21   收藏:0   阅读:551

当用户点击窗体上的关闭按钮时,如果不想关闭窗体而是隐藏它,可采用下面的方法。

// Use this event handler for the FormClosing event.
private void MyForm_FormClosing(object sender, FormClosingEventArgs e)
{
   this.Hide();
   e.Cancel = true; // this cancels the close event.
}

实现隐藏窗体而非关闭的方法,布布扣,bubuko.com

原文:http://www.cnblogs.com/xpvincent/p/3611499.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!