Visual Basic - Drag & Drop

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

Drag & Drop

Publicado por anonymous (171 intervenciones) el 30/11/2011 19:34:36
Hola Compañeros, no he podido hacer que un control Marchoso active un command button mediante dragDrop, o sea, que al hacer click en el gif y arrastrarlo hacia el botón éste se active o aparezca otro marchoso2. es el código que tengo por si alguien puede ayudarme, GRACIAS de antemano::

Dim dX As Single
Dim dY As Single

Private Sub Command1_DragDrop(Source As Control, X As Single, Y As Single)
If Source.Name = Marchoso1 Then
MsgBox "pegar en command1"
End If
End Sub

Private Sub Form_Load()
Marchoso1.FileName = App.Path & "\libros.gif"
End Sub

Private Sub Marchoso1_DragDrop(Source As Control, X As Single, Y As Single)
IniciarDrag Marchoso1, Button, dX, dY
End Sub

Private Sub FinalizarDrag(Source As Control, Button As Integer)
If Button = vbLeftButton Then
Source.Visible = True
Source.Drag vbEndDrag
End If
End Sub

Private Sub IniciarDrag(Source As Control, Button As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
dX = X
dY = Y
Source.Drag vbBeginDrag
Source.Visible = False
Source.Drag
End If
End Sub

Private Sub marchoso1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
IniciarDrag Marchoso1, Button, X, Y
End Sub

Private Sub marchoso1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
FinalizarDrag Marchoso1, Button
End Sub

Private Sub Marchoso2_GifImage(repaint As Boolean)
Marchoso2.FileName = App.Path & "\libros.gif"
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder