VB6.0写的,代码很简单,无意中写成的。应该可以参考。不需要任何api函数。在无边框窗体顶部中放入一个label标签。然后用label的 mouse down 和mouse move事件实现
Dim a, b As Single Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) a = X b = Y End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Form1.Move Left + X - a, Top + Y - b End If End Sub