码迷,mamicode.com
首页 > 移动开发 > 详细

移动窗体(边框设置为None后的窗体)

时间:2014-08-04 10:54:36      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   art   ar   

bubuko.com,布布扣
 1 #region 移动窗体(边框设置为None后的窗体)
 2 
 3         /// <summary>
 4         /// 重写WndProc方法,实现窗体移动和禁止双击最大化
 5         /// </summary>
 6         /// <param name="m">Windows 消息</param>
 7         protected override void WndProc(ref Message m)
 8         {
 9             switch (m.Msg)
10             {
11                 case 0x4e:
12                 case 0xd:
13                 case 0xe:
14                 case 0x14:
15                     base.WndProc(ref m);
16                     break;
17                 case 0x84://鼠标点任意位置后可以拖动窗体
18                     this.DefWndProc(ref m);
19                     if (m.Result.ToInt32() == 0x01)
20                     {
21                         m.Result = new IntPtr(0x02);
22                     }
23                     break;
24                 case 0xA3://禁止双击最大化
25                     break;
26                 default:
27                     base.WndProc(ref m);
28                     break;
29             }
30         }
31         
32         #endregion
View Code

 

移动窗体(边框设置为None后的窗体),布布扣,bubuko.com

移动窗体(边框设置为None后的窗体)

标签:style   blog   http   color   os   io   art   ar   

原文地址:http://www.cnblogs.com/ydchw/p/3889516.html

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