1 | namespace WindowsApplication1 |
2 | { |
3 | public partial class Form1 : Form |
4 | { |
5 | public Form1() |
6 | { |
7 | InitializeComponent(); |
8 | } |
9 | private const int WM_NCHITTEST = 0x84; |
10 | private const int HTCLIENT = 0x1; |
11 | private const int HTCAPTION = 0x2; |
12 | private const int WM_NCLBUTTONDBLCLK = 0xA3;//鼠标双击标题栏消息 |
13 | |
14 | protected override void WndProc(ref Message m) |
15 | { |
16 | switch (m.Msg) |
17 | { |
18 | case WM_NCHITTEST: |
19 | base.WndProc(ref m); |
20 | if ((int)m.Result == HTCLIENT) |
21 | m.Result = (IntPtr)HTCAPTION; |
22 | return; |
23 | case WM_NCLBUTTONDBLCLK: |
24 | break; |
25 | default: |
26 | base.WndProc(ref m); |
27 | break; |
28 | } |
29 | |
30 | } |
31 | } |
32 |
c#无边框窗体移动 屏蔽双击最大化
最新推荐文章于 2024-07-14 17:14:55 发布