If I move the mouse pointer over a specific X and Y coordinate, I want to run a function.
If I have a button on my form and I move the mouse pointer over the buttons (x , y) coordinates the function must run. Then if the mouse is moved away from the button a different function must run.
Hope you understand what I'm trying to say!
Thanks for you're help in advance!
Take a look at:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
You may also call your function from the MouseMove event of the form or control over which you're moving the mouse.
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
yeah... the mousemove event's probably easier.
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
if X = [your x value] and Y = [your y value] then
However, if you only want the program to call the function while the mouse is over a particular button, you have to use the Command1.Top and Command1.Left declarations:
if X = Command1.Left and Y = Command1.Top then
However, even if you use exactly that statement the program will only call the function on that one point (Command1.Left, Command1.Top). So you'll have to do some math with the Command1.Height and Command1.Width variables.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center