1、WPF雙擊事件 別走彎路-CSDN論壇.html(https://bbs.csdn.net/topics/392493855?list=2474794)
2、
private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { switch (e.ClickCount) { case 1://單擊 { NativeMethods.SendMessage(Hwnd, (int)WindowMessages.WM_NCLBUTTONDOWN, (IntPtr)HitTest.HTCAPTION, IntPtr.Zero); break; } case 2://雙擊 { WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; break; } }
3、ZC:我自己 測試了一下:雙擊 Image控件時,MouseDown事件 和 LeftButtonDown事件 中 e.ClickCount能 得到 數值2,事件MouseUp、事件LeftButtonUp中 無法得到 數值2 一直都是 數值1 ...
PS:只有當 Image控件中 有圖片(設置了source屬性)之后,才能點擊到 Image控件,沒有圖片的話 感覺起來像是 Image的大小是 0一樣 點不到它...
4、
5、