
18/03/2007, 12:00
|
| | Fecha de Ingreso: noviembre-2006
Mensajes: 437
Antigüedad: 18 años, 5 meses Puntos: 3 | |
Previsualización de imagenes y Drag&Drop Hola a todos! verán, tengo el siguiente codigo:
Public Sub carga_articulo()
Set foto = cnt.Execute("Select * from fotos where id='" & codigo.Text & "'")
i = 0
Do Until foto.EOF
i = i + 1
Load Me.Imagefoto(i)
Me.Imagefoto(i).Visible = True
Load Me.Label1(i)
Me.Label1(i).Visible = True
Me.Imagefoto(i).Picture = LoadPicture(app.Path & "\" & foto.Fields("foto_ruta"))
Me.Label1(i).Caption = foto.Fields("fecha")
Me.Imagefoto(i).Left = Me.Imagefoto(0).Width * i
Me.Label1(i).Left = Me.Label1(0).Width * i
foto.MoveNext
Loop
TotalObjetosCreados = i
End Sub
Private Sub pfotop_DragDrop(Source As Control, X As Single, Y As Single)
pfotop.Picture = Imagefoto(i).Picture
End Sub
Private Sub Imagefoto_MouseDown(i As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
'Si el boton del raton es el derecho, no hacemos nada
If Button = 2 Then Exit Sub
Imagefoto(i).Drag 1
DragX = X
DragY = Y
End Sub
Private Sub Imagefoto_MouseUp(i As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Imagefoto(i).Drag 2
End Sub
Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move (X - DragX), (Y - DragY)
End Sub
Al querer hacer Drag&Drop de una imagen selecionada y arrastrarla a otro picture siempre me muestra la ultima cargada, por ejemplo, si hay tres imagenes, seleccionando la que sea y arrastrandola al picture siempre me muestra la tercera, es un problema de indices pero nosé como solucionarlo.
También me gustaria implementar una barra de scroll horizontal en el frame donde salen las imagenes para que cuando se creen más del ancho permitdo del frame se active la barra de scroll y pueda visualizar todas las imagenes. He estado mirando codigos fuente de ejemplos pero no he dado con la solución, si alguien tiene algun ejemplo se lo agradeceria.
Un saludo y espero que me puedan ayudar
Última edición por komodo; 18/03/2007 a las 19:36 |