vb编程高手进~

来源:百度知道 编辑:UC知道 时间:2024/05/12 02:11:38
Dim a

Option Explicit
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Sub Command1_Click()
If a = "鼠标不在控件Picture1上面" Then

Form1.Left = Form1.Left + 100

'====================================================================================

End If

End Sub

Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = True

Timer2.Interval = 1
Timer2.Enabled = True

Timer3.Interval = 1
Timer3.Enabled = True

Command1.Visible = False
Command2.Visible = False

End Sub

Private

Dim a

Option Explicit
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Sub Command1_Click()
If a = "鼠标不在控件Picture1上面" Then

Form1.Left = Form1.Left + 100
End If

'====================================================================================

End Sub

Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = True

Timer2.Interval = 1
Timer2.Enabled = True

Timer3.Interval = 1
Timer3.Enabled = True

Command1.Visible = False
Command2.Visible = False

End Sub

Private Sub