首页 > Windows开发 > 详细

winform 船体最大化事件

时间:2017-12-07 18:18:22      阅读:188      评论:0      收藏:0      [点我收藏+]
protected override void WndProc(ref Message m)
        {
            FormWindowState previousWindowState = this.WindowState;

            base.WndProc(ref m);

            FormWindowState currentWindowState = this.WindowState;

            if (previousWindowState != currentWindowState && currentWindowState == FormWindowState.Maximized)
            {
                // TODO: Do something the window has been maximized

            }
        }
const int WM_SYSCOMMAND = 0x112;
const int SC_CLOSE = 0xF060;
const int SC_MINIMIZE = 0xF020;
const int SC_MAXIMIZE = 0xF030;
protected override void WndProc(ref Message m)
{
    if (m.Msg == WM_SYSCOMMAND)
    {
        if (m.WParam.ToInt32() == SC_MINIMIZE)
        {
            this.Visible = false;
            return;
        }
    }
    base.WndProc(ref m);
}//网上这个会出问题 应该是变量的问题

 

winform 船体最大化事件

原文:http://www.cnblogs.com/kbqLibrary/p/8000178.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!