sherrick123
asked on
drag and drop from one list box to another
I was wanting to use the drag and drop option to add selected files from one listbox control to another.
i have the listbox set to multiselect.
I have it working now with a button the user has to press then of course i loop through all the selected items and add those to the other list box
Thanks
i have the listbox set to multiselect.
I have it working now with a button the user has to press then of course i loop through all the selected items and add those to the other list box
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is How I am populating the COPY FROM list box
Private Sub cboFiles_SelectedIndexChan ged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboFiles.SelectedIndexChan ged
Try
Dim mySelDir As New DirectoryInfo(cboFiles.Sel ectedItem)
Dim myFilename As FileInfo
Dim myImageDir(1) As DirectoryInfo
Dim myText As String
myImageDir = mySelDir.GetDirectories("I mages")
lstDgnFiles.Items.Clear()
lblOutPutDir.Text = myImageDir(0).FullName.ToS tring
For Each myFilename In mySelDir.GetFiles("*.dgn")
lstDgnFiles.Items.Add(myFi lename) 'Add tostring to get out of the filename
Next myFilename
Catch ex As Exception
MessageBox.Show("The process failed: {0}", ex.ToString())
End Try
Private Sub cboFiles_SelectedIndexChan
Try
Dim mySelDir As New DirectoryInfo(cboFiles.Sel
Dim myFilename As FileInfo
Dim myImageDir(1) As DirectoryInfo
Dim myText As String
myImageDir = mySelDir.GetDirectories("I
lstDgnFiles.Items.Clear()
lblOutPutDir.Text = myImageDir(0).FullName.ToS
For Each myFilename In mySelDir.GetFiles("*.dgn")
lstDgnFiles.Items.Add(myFi
Next myFilename
Catch ex As Exception
MessageBox.Show("The process failed: {0}", ex.ToString())
End Try
ASKER
Private Sub lstDgnFiles_MouseDown(ByVa
lstDgnFiles.DoDragDrop(lst
End Sub
Private Sub lstMakePDF_DragEnter(ByVal
If e.Data().GetDataPresent(Da
e.Effect() = DragDropEffects.Move
Else
e.Effect() = DragDropEffects.None
End If
End Sub