Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) oldX = X - Shape1.Left oldY = Y - Shape1.Top
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Shape1.Left = X - oldX Shape1.Top = Y - oldY Label1(0).Left = X - oldX - Label1(0).Width Label1(0).Top = Y - oldY - Label1(0).Height Label1(1).Left = Shape1.Left + Shape1.Width Label1(1).Top = Shape1.Top - Label1(1).Height Label1(2).Left = X - oldX - Label1(2).Width Label1(2).Top = Y - oldY + Shape1.Height Label1(3).Left = Shape1.Left + Shape1.Width Label1(3).Top = Shape1.Top + Shape1.Height End If End Sub
Private Sub Label1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) oldX = X oldY = Y
End Sub
Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) On Error Resume Next If Button = 1 Then Label1(Index).Move Label1(Index).Left + X - oldX, Label1(Index).Top + Y - oldY Select Case Index Case 0 Label1(2).Left = Label1(0).Left Label1(1).Top = Label1(0).Top Case 1 Label1(0).Top = Label1(1).Top Label1(3).Left = Label1(1).Left Case 2 Label1(0).Left = Label1(2).Left Label1(3).Top = Label1(2).Top Case 3 Label1(1).Left = Label1(3).Left Label1(2).Top = Label1(3).Top End Select Shape1.Move Label1(0).Left + Label1(0).Width, _ Label1(0).Top + Label1(0).Height, _ Label1(1).Left - Label1(0).Left - Label1(0).Width, _
Label1(3).Top - Label1(1).Top - Label1(1).Height End If End Sub