把picture做为容器
在picture的move里面判断

解决方案 »

  1.   

    Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
    Source.Move X, Y
    Set Source.Container = Picture1
    end sub
      

  2.   

    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 Long) As LongConst HTCAPTION = 2
    Const WM_NCLBUTTONDOWN = &HA1
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
    If Button = 1 Then
        ReleaseCapture
        SendMessage Command1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
    End If
    End Sub
      

  3.   

    Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
        Picture2.Left = X
        Picture2.Top = Y
        If Picture2.Top > Picture1.Height - 75 Then Picture2.Top = Picture1.Height - 75
        If Picture2.Top < 30 Then Picture2.Top = 30
        If Picture2.Left > Picture1.Width - 75 Then Picture3.Left = Picture1.Width - 75
        If Picture2.Left < 60 Then Picture3.Left = 60
    End Sub
      

  4.   

    Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
        Picture2.Left = X
        Picture2.Top = Y
        If Picture2.Top > Picture1.Height - 75 Then Picture2.Top = Picture1.Height - 75
        If Picture2.Top < 30 Then Picture2.Top = 30
        If Picture2.Left > Picture1.Width - 75 Then Picture2.Left = Picture1.Width - 75
        If Picture2.Left < 60 Then Picture2.Left = 60
    End Sub
      

  5.   

    Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
        Picture2.Left = X
        Picture2.Top = Y
        If Picture2.Top > Picture1.Height - 75 Then Picture2.Top = Picture1.Height - 75
        If Picture2.Top < 30 Then Picture2.Top = 30
        If Picture2.Left > Picture1.Width - 75 Then Picture2.Left = Picture1.Width - 75
        If Picture2.Left < 60 Then Picture2.Left = 60
    End Sub