欢迎来到Java学习网!
设为首页 | 加入收藏
当前位置: 首页 > 编程开发 > VB语言 >

Option Explicit

Dim mX As Long, mY As Long

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
mX = X: mY = Y
End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
Me.Move Me.Left - mX + X, Me.Top - mY + Y
End If
End Sub

 

    相关教程
    推荐内容