Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否也可以为窗口的边框创建一个 MouseEnter-Event?我的意思也是最小化和最大化按钮。因为如果我为我的 Form1 设置事件,它仅在我在表单内时有效,而不是在边框和按钮上。
您可以在表单中覆盖 WndProc 并且可以检测 mousemove
protected override void WndProc(ref Message m) { base.WndProc(ref m); // mouse in window or in Border and max, close & min buttons if (m.Msg == 0xa0 || m.Msg == 0x200) { //Do some thing } }