当D2010中的鼠标不移动时,OnMouseMove为什么会反复触发? [英] Why does OnMouseMove fire repeatedly when the mouse is not moving in D2010?
问题描述
有人知道是什么原因造成的,如何解决?
我的心灵调试感觉告诉我你在Windows上,标签是一个工具提示窗口,您正在每个mousemove进行更新。
在所有严重性中,我已经看到了这个确切的事情工具提示窗口,当我们切换到Vista。似乎更新版本的Windows工具提示窗口在更新时会产生WM_MOUSEMOVE消息。我唯一可以找到的解决方案是仅在文本实际更改时才更新标签。
所以,如果你不在Windows上,请忽略我。但是如果您使用的是Windows,请尝试仅在实际更改标签文本时更新。
I'm porting a Delphi 5 app to D2010, and I've got a bit of a problem. On one form is a TImage component with an OnMouseMove event that's supposed to update a label whenever the mouse is moved over the image. This worked just fine in the original app, but now the OnMouseMove event fires constantly whenever the mouse is over the image, whether it's moving or not, which causes the label to flicker horribly.
Does anyone know what's causing this and how to fix it?
My psychic debugging sense tells me that you are on Windows, the label is a tooltip window and you are updating on every mousemove.
In all seriousness, I've seen this exact thing with tooltip window when we switched to Vista. It seems that more recent versions of the Windows tooltip window somehow generate WM_MOUSEMOVE messages when you update them. The only fix I could find was to only update the label when the text actually changes.
So, If you aren't on windows, Ignore me. But if you are on Windows, try updating the label text only when it actually changes.
这篇关于当D2010中的鼠标不移动时,OnMouseMove为什么会反复触发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!