Option ExplicitDefLng A-ZDim Boton As IntegerDim Coordy As IntegerPrivate Sub Form_Load()'Permitimos al control image una operacion de arrastre Image1.OLEDragMode = 1 Image3.OLEDragMode = 1 Me.OLEDropMode = 1Call PngImageLoad("C:\r.png", Image1) 'para cargarlo en el image1Call PngImageLoad("C:\am.png", Image3) 'para cargarlo en el image1End SubPrivate Sub Form_DragDrop(Source As Control, X As Single, Y As Single) With Image1 .Drag vbEndDrag .Move X - mx, Y - my End WithEnd SubPrivate Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Image1.Drag vbBeginDrag mx = X: my = YEnd SubPrivate Sub Form_OLEDragOver(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, _ X As Single, Y As Single, State As Integer) Boton = ButtonEnd Sub 'Evento que se ejecuta al soltar la imagen en el formularioPrivate Sub Form_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single) On Error Resume Next 'Le decimos que sea una copia de lo que vamos a arrastrar Effect = vbDropEffectCopy If Boton = vbLeftButton Then Me.PaintPicture data.GetData(2), X, Y End IfEnd SubPrivate Sub Image2_Click()On Error GoTo cancelar 'en caso de que halla un error ir a cancelarDim archivo As String archivo = "x:\ubicacion del archivo.txt"Open archivo For Append As #1 'sintaxis para guardar una archivoPrint #1, Text1.Text & " " & Text2.TextText3.Text = Text3.Text & IIf(Text3.Text <> "", vbCrLf, "") & Text1.Text & " " & Text2.TextClose 'cerramos el archivocancelar: 'accion que va a tomar si hay algun error.End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Const Ancho = 0.3Const Alto = 0.3Dim CoordX As Single, CoorY As SingleDim X1 As Single, Y1 As Single, W1 As Single, H1 As SingleDim file As Integer, col As IntegerIf Button = vbLeftButton Then CoordX = X - ((Picture1.ScaleWidth * Ancho) / 2) If CoordX < 0 Then CoordX = 0 If (CoordX + (Ancho * Picture1.ScaleWidth)) > Picture1.ScaleWidth Then CoordX = Picture1.ScaleWidth * (1 - Ancho) End If Coordy = Y - ((Picture1.ScaleHeight * Alto) / 2) If Coordy < 0 Then Coordy = 0 If (Coordy + (Alto * Picture1.ScaleHeight) > Picture1.ScaleHeight) Then Coordy = Picture1.ScaleHeight * (1 - Alto) End If Text1.Text = CoordX Text2.Text = Coordy End IfEnd Sub