View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Determine closest control to MouseUp event?

Robert Baer wrote:

Auric__ wrote:
Is there an easy, accurate method to determine the closest control to a
MouseUp (or MouseDown, if it's easier) event, if the user clicks on the
UserForm instead of a control? (My form will be used on a touch
screen.)

My current best guess is to do it manually (so to speak): look at the
coordinates of the click, and then look at the coordinates of each
control and decide which one is closest. I'm sure it'll work, but it's
going to be a PITA, and I'm looking for something built-in, or
alternately code that's already been written. (My google-fu has failed
me here.)

Javascript can definitely get you X,Y pixel positions. Screen is ASS-u-MEd
to be 80x600, fixed.


[snip code]

....okay. Now just show me how that will work with Excel.

--
He was here just a minute ago...
-- George Carlin's desired epitaph