Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouseover or Mouse Move events Geoff[_9_] Excel Programming 0 April 4th 05 08:24 PM
controlling from xls , word events jlsainz Excel Programming 0 September 18th 04 11:06 PM
controlling another application via VBA code in Excell & sending keystrokes & mouse clicks Zaidan Excel Programming 0 June 6th 04 09:06 PM
Mouse-move flicker, modeless form & shape selected Paul Stevens Excel Programming 2 February 10th 04 02:07 PM
Controlling the mouse Brian Sharf Excel Programming 1 July 21st 03 08:24 AM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"