1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Option Explicit
Dim T, StartX, StartY As Integer
Private Sub Command1_Click()
If Form1.Tag <> "" Then
FormExplorateur.Drive1.Drive = Left$(Form1.Tag, 2)
FormExplorateur.Dir1.Path = Form1.Tag
If PictOuverte.Tag <> "" Then
For T = 0 To FormExplorateur.File1.ListCount - 1
If FormExplorateur.File1.List(T) = PictOuverte.Tag Then
FormExplorateur.File1.Selected(T) = True: Exit For
End If
Next T
End If
End If
FormExplorateur.Caption = "Ouvrir "
FormExplorateur.Show 1
End Sub
Private Sub PictOuverte_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 2 And Me.Tag <> "" Then
StartX = X: StartY = Y:
PictOuverte.Drag (1) 'ctrl et coordonnées de depart
Exit Sub
End If
PictOuverte.ZOrder
End Sub
Private Sub PictResult_Click()
PictResult.ZOrder
End Sub
Private Sub PictResult_DragDrop(Source As Control, X As Single, Y As Single)
Source.Drag (2) ' met fin au deplacement
'nouveau placement
PictResult.PaintPicture PictOuverte.Picture, X - StartX, Y - StartY, , , 0, 0
PictResult.ZOrder
End Sub |
Partager