拖动无边框窗体(VB6代码)
作者:admin 日期:2009-06-29
简单代码片段,记录一下备用.
复制内容到剪贴板
程序代码

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'
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'
评论: 0 | 引用: 0 | 查看次数: 1247