Saphirah
Active member
- Local time
- Today, 11:31
- Joined
- Apr 5, 2020
- Messages
- 163
Hello everyone,
i want a control to receive focus whenever the mouse hovers above it.
For this i use the following VBA Code:
Now this should happen on multiple controls. Ofc it is very hideous to program this for every control, because it is always the same code.
As you probably know, you can use functions in the Controls Mouse Move Events. (Screenshot is german, but you get the point)
But inside this function i have no possibility to determine which control should receive the focus, because i do not know which control executed the function.
Sooooo.... How can one do that? Is there maybe a better way to do that?
Thank you very much for your help!
i want a control to receive focus whenever the mouse hovers above it.
For this i use the following VBA Code:
Code:
Private Sub ExampleCtrl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
ExampleCtrl.SetFocus
End Sub
Now this should happen on multiple controls. Ofc it is very hideous to program this for every control, because it is always the same code.
As you probably know, you can use functions in the Controls Mouse Move Events. (Screenshot is german, but you get the point)
But inside this function i have no possibility to determine which control should receive the focus, because i do not know which control executed the function.
Sooooo.... How can one do that? Is there maybe a better way to do that?
Thank you very much for your help!
Last edited: