Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Controlling flicker in mouse move events
Greetings,
In a class I am currently teaching we are about to talk about gradient vectors. I prepared an XY scatter-chart whose background was set to be a contour-map of a function of 2 variables. I wrote a mouse-move event handler which draws the gradient to the surface at that point. After I was finally able to find a way to translate from the annoying "client coordinates" returned by the mouse move event into the coordinate system determined by the chart axis, I was able to get it to work as I intended. The problem is - flicker! Big time. I've tried things like briefly turning off screen updating, etc. But nothing seems to work. From this group I downloaded a function to wrap an API call to LockWindows (or something like that), but it didn't seem much better than toggling screen-updating. In frustration, I turned it into a mouse-down event. I can still move around the contour, clicking here and there to display the gradient, but it now lacks the animation which would be have been cool. Is there a work around or is this just an unavoidable by-product of the fact that Excel wasn't designed for animation? Thanks in advance -John Coleman |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Controlling flicker in mouse move events
John,
I suggest, instead of using mouse_move, to make the code a standard macro and assign the macro to a keyboard key by means of Application.OnKey. When you hold down the key it should repeatedly execute the macro. Based on very limited experience, it is smoother than mouse-move and obviously has the advantage of easily being turned-off (let go the key). Note that I only suspect it will work. I have no experience other than with a much simpler scenario. Interested in the outcome pro or con. Regards, Greg "John Coleman" wrote: Greetings, In a class I am currently teaching we are about to talk about gradient vectors. I prepared an XY scatter-chart whose background was set to be a contour-map of a function of 2 variables. I wrote a mouse-move event handler which draws the gradient to the surface at that point. After I was finally able to find a way to translate from the annoying "client coordinates" returned by the mouse move event into the coordinate system determined by the chart axis, I was able to get it to work as I intended. The problem is - flicker! Big time. I've tried things like briefly turning off screen updating, etc. But nothing seems to work. From this group I downloaded a function to wrap an API call to LockWindows (or something like that), but it didn't seem much better than toggling screen-updating. In frustration, I turned it into a mouse-down event. I can still move around the contour, clicking here and there to display the gradient, but it now lacks the animation which would be have been cool. Is there a work around or is this just an unavoidable by-product of the fact that Excel wasn't designed for animation? Thanks in advance -John Coleman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mouseover or Mouse Move events | Excel Programming | |||
controlling from xls , word events | Excel Programming | |||
controlling another application via VBA code in Excell & sending keystrokes & mouse clicks | Excel Programming | |||
Mouse-move flicker, modeless form & shape selected | Excel Programming | |||
Controlling the mouse | Excel Programming |