Private Sub picClip_DragDrop(Source As Control, X As Single, y As Single)
  If Not Source Is picClip Then Exit Sub
  picClip.Move picClip.Left + X, picClip.Top + y
End Sub

解决方案 »

  1.   

    to  qqqdong:试了一下,要移动的控件没啥反应,picClip是指容器窗口还是要移动的控件
    ??
      

  2.   

    控件的DragMode属性要设置为1-Automatic
      

  3.   

    试试这个东东吧:)
    http://www.codestudy.net/bbs/uploadImages/2002123016443681745.rarhttp://www.xygu.com
      

  4.   

    http://www.codestudy.net/bbs/dispbbs.asp?boardID=47&RootID=4415&ID=4415楼上的,你怎么把我的东西贴到这里来了??
    这是我用来打广告的。你下次贴我写的这个链点好不好啊??,呵呵!
      

  5.   

    这是我做的一个窗体:两个PictureBox --- picPhoto & picClip
    Option Explicit
    Dim llX As Long
    Dim llY As Long
    Dim lstrFileName As StringPrivate Sub Form_Load()
      lstrFileName = Trim(frmUser.txtCardID.Text)
      Me.Caption = Me.Caption + "[" + lstrFileName + "]"
    End SubPrivate Sub picClip_DragDrop(Source As Control, x As Single, y As Single)
      If Not Source Is picClip Then Exit Sub
      picClip.Move picClip.Left + x - llX, picClip.Top + y - llY
    End SubPrivate Sub picClip_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
      llX = x
      llY = y
      picClip.Drag
    End SubPrivate Sub picPhoto_DragDrop(Source As Control, x As Single, y As Single)
      If Not Source Is picClip Then Exit Sub
      picClip.Move x - llX - glLeft, y - llY - glTop
    End Sub