N
Nathan
I'm working for the first time with the DoDragDrop method. I've got almost
everything worked out, but I need some help with the last bit.
There are two listboxes on my form, lstGroups and lstStudents. I want to be
able to drag a name from lstStudents and drop it on one of the names in
lstGroups to move it to that group. I've got the dragging part working;
it's just the dropping that isn't there yet. I'm working with what I can
find from the msdn library and another sample project I found. I'm trying
to convert the code from the samples to the code I need for my project.
This is the lstGroups.DragDrop sub I have so far:
Private Sub lstGroups_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles lstGroups.DragDrop
Dim Pt As Point = lstGroups.PointToClient(New Point(e.X, e.Y))
Dim DestinationFolder As String = lstGroups.GetItemText(Pt)
End Sub
I want DestinationFolder to be assigned the text of the group name (in
lstGroups) where the student's name is dropped. The code above is giving me
the x/y coordinates of Pt. Where do I go from here?
Thanks a lot,
Nathan
everything worked out, but I need some help with the last bit.
There are two listboxes on my form, lstGroups and lstStudents. I want to be
able to drag a name from lstStudents and drop it on one of the names in
lstGroups to move it to that group. I've got the dragging part working;
it's just the dropping that isn't there yet. I'm working with what I can
find from the msdn library and another sample project I found. I'm trying
to convert the code from the samples to the code I need for my project.
This is the lstGroups.DragDrop sub I have so far:
Private Sub lstGroups_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles lstGroups.DragDrop
Dim Pt As Point = lstGroups.PointToClient(New Point(e.X, e.Y))
Dim DestinationFolder As String = lstGroups.GetItemText(Pt)
End Sub
I want DestinationFolder to be assigned the text of the group name (in
lstGroups) where the student's name is dropped. The code above is giving me
the x/y coordinates of Pt. Where do I go from here?
Thanks a lot,
Nathan