cs_Jack
Messages postés14007Date d'inscriptionsamedi 29 décembre 2001StatutModérateurDernière intervention28 août 201579 28 déc. 2005 à 04:24
(humour, quand tu nous tiens ...)
Alors, il faut :
- Propriété OLEDragMode du ListBox à "1- Automatic"
- Propriété OLEDropMode du TextBox à "0 - Manual"
- Dans l'évènement List1_OLEStartDrag du ListBox :
Dim r As Long, Temp As String
' Place dans l'objet la liste des données qui sont sélectionnés
For r = 0 To (List1.ListCount - 1)
If List1.Selected(r) = True Then
Temp = Temp & List1.List(r) & vbCrLf
End If
Next r
' Précise que l'objet est une liste de textes
Data.Clear
Data.SetData Temp, vbCFText
' Type de DragDrop
AllowedEffects = vbDropEffectCopy
- Dans l'évènement Text1_OLEDragDrop du TextBox :
Dim Temp As String
Temp = Data.GetData(vbCFText)
Text1.Text = Text1.Text & Temp
Voilà, c'est tout.
Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés
Le savoir est la seule matière qui s'accroit quand on la partage. (Socrate)