如何判断鼠标是否移到控件上?
如何判断鼠标是否移到控件上,当移到控件上时发生一种变化,当移开控件时又发生一种变化
鼠標函數
Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Option Explicit
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X > 0 And Y > 0 And X < Command1.Width And Command1.Height Then
Command1.FontSize = 16
SetCapture Command1.hwnd
Else
Command1.FontSize = 10
ReleaseCapture
End If
End Sub