PDA

View Full Version : [VB6] drag & Drop


gbv
15-12-2003, 12:34
come faccio a visualizzare il testo di ciņ che sto trascinando?
(al posto del rettangolo)
grazie anticipatamente

matpez
15-12-2003, 14:56
Ci sono vari drag & drop

Quello interno alla form e quello da fuori a dentro alla form

Fammi capire bene cosa ti serve...

gbv
15-12-2003, 17:05
ciao ho una listbox da dove prendo i dati e una text dove metto i dati.
uso una label come appoggio

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Label2.Caption = List1.Text
Label2.Top = Y + List1.Top
Label2.Left = X + List1.Left
Label2.Drag

End Sub

Private Sub Text1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
If List1.ListIndex = -1 Then
If List1.ListCount < 0 Then
MsgBox "non ci sono elementi da trascinare"
Exit Sub
End If
Exit Sub
Else
Text1(Index).Text = Label2.Caption
List1.RemoveItem List1.ListIndex
End If
End Sub

gbv
16-12-2003, 20:11
up :)