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

Peter T wrote:

"Auric__" wrote in message
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.)


If I follow your objective try this


[snip code]

** only lightly tested! **


Looks promising. I'll hack away at it tonight and see what happens. Thank
you.

--
heh, i dont even know how to hack a system
i am always amazed when i hear such stories
hell, half the time I can't get into my own damn box, much less someone elses