码迷,mamicode.com
首页 > Windows程序 > 详细

winform 船体最大化事件

时间:2017-12-07 19:05:43      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:sys   win   prot   amp   const   proc   his   inf   div   

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 船体最大化事件

标签:sys   win   prot   amp   const   proc   his   inf   div   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!