看来你只能用程序来实现了,在DragDrop事件中编码吧

解决方案 »

  1.   

    利用winAPI,releaseDC   Sendmessage
      

  2.   

    新建一个模块,加入SendMessage的函数声明:
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    在需要移动的地方的MouseDown事件中加入“If Button <> 1 Then Exit Sub
        ReleaseCapture
        SendMessage Me.hwnd, &HA1, 2, 0&
    ”例如:
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    '拖动窗口
        If Button <> 1 Then Exit Sub
        ReleaseCapture
        SendMessage Me.hwnd, &HA1, 2, 0&
    End Sub
    这个功能在Vb.Net中实现是比在Vb6.0中酷多了!
      

  3.   

    新建一个模块,加入SendMessage的函数声明:
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    函数声明:
    Public Declare Function ReleaseCapture Lib "user32" () As Long
    在需要移动的地方的MouseDown事件中加入“If Button <> 1 Then Exit Sub
        ReleaseCapture
        SendMessage Me.hwnd, &HA1, 2, 0&
    ”例如:
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    '拖动窗口
        If Button <> 1 Then Exit Sub
        ReleaseCapture
        SendMessage Me.hwnd, &HA1, 2, 0&
    End Sub
    这个功能在Vb.Net中实现是比在Vb6.0中酷多了!
      

  4.   

    '32 位版本: ( Function 有返回值,Integer 改成 Long )
    Private Declare Function ReleaseCapture _
    Lib "user32" () As Long
    Private Declare Function SendMessage Lib "user32" _
    Alias "SendMessageA" (ByVal hwnd As Long, _
    ByVal wMsg As Long, ByVal wParam As Long, _
    lParam As Any) As Long'共用常数:
    Const WM_SYSCOMMAND = &H112
    Const SC_MOVE = &HF012'若要移动 Form,程序码如下:
    Private Sub Form_MouseDown(Button As Integer, _
    Shift As Integer, X As Single, Y As Single)
    Dim i As Long
    i = ReleaseCapture
    i = SendMessage(Form1.hwnd, _
    WM_SYSCOMMAND, SC_MOVE, 0)
    End Sub
      

  5.   

    上面的方法,只在win98中可以,win2000下不行。可以用spy查一下发送的是什么消息。
      

  6.   

    具体怎么做我忘了,在《vb与API实战中》的思路是这样的,用API函数找到窗口过程的地址,好想是getaddresof函数,然后找到他的窗口过程,截获nctest(具体的我忘了,就是鼠标在客户区的点击事件),然后把他改成点击标题栏就搞定了
      

  7.   

    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Public Declare Function ReleaseCapture Lib "user32" () As LongPublic Sub Drag_me(Object_Name As Object)
        ReleaseCapture
        SendMessage Object_Name.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    End Sub
    '''''''''''
    在Form的MouseDown事件里打
    Drag_me me
      

  8.   

    我用了一个笨笨的方法,检测FORM的MOUSEMOVE,要是左键按下就根据MOUSE的位移改变FORM的位置。我够笨吧!不过100%灵验。