which control triggered the MouseMove event?

jeremyr

New member
Local time
Today, 12:02
Joined
Mar 24, 2008
Messages
4
I have a number of controls on a form. They all point to the same function when the mousemove event is triggered

How can I get this function to find out the name of the control that has triggered the on mouse move event?

Thanks in advance for saving my hair!

-Jeremy
 
merely pass the Control within the Function call. For example, if you have a function (MyFunctionName) placed directly into the MouseMove event property like this:

=MyFunctionName()

and you want to pass the control (Text1) that fired it, then your property entry should look like this:

=MyFunctionName([Text1])

Of course you will also need to modify the Function itself so as to handle the Control name. Perhaps something like this:

Code:
Private MyFunctionName (ByRef Ctrl As Control)
   [COLOR="DarkGreen"]'---- Your Code here ----[/COLOR]
   MsgBox "The MouseMove event of the control named" &  Ctrl.Name & " had fired this Function"
End Function

.
 
or you might be able to get it in the function with just

screen.activecontrol
 

Users who are viewing this thread

Back
Top Bottom