Using WndProc() also seems unrealistic for such a simple request, is there any other way to do this, or if WndProc() is the only way, has anyone actually been able to achieve this and show me how?推荐答案对此没有干净的解决方案.您的面板操作也不起作用,当用户快速移动鼠标时,它将完全被忽略.There is no clean solution for this. Your panel trick doesn't work either, it will be completely missed when the user moves the mouse quickly.平底锅.一旦获得MouseEnter,就启动一个200毫秒的计时器.在滴答"事件中,检查鼠标是否仍悬停在树视图上.例如:Punt. Once you get MouseEnter, start a 200 msec Timer. In the Tick event, check if the mouse is still hovering the tree view. For example: private void treeView1_MouseEnter(object sender, EventArgs e) { timer1.Enabled = true; treeView1.Width = 220; } private void timer1_Tick(object sender, EventArgs e) { Point pos = treeView1.PointToClient(Cursor.Position); if (!treeView1.DisplayRectangle.Contains(pos)) { timer1.Enabled = false; treeView1.Width = 50; } } Application.Idle事件的工作太顺便了,只是有点尴尬.The Application.Idle event works too btw, just a wee bit more awkward. 这篇关于将鼠标移到控件的ScrollBar上时,将触发MouseLeave事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-20 13:00