jcardana
Old to VB6, New to VB.NET
There are conflicts between trying to select an item (single-click), double-clicking an item "to open" and dragdrop.
I had the dragdrop working copying one item to another list. But now when I try to doubleclick to "open" an item, I find myself in the drapdrop methods.
As always, I add one thing and I break another.
Thank for any help you have to offer,
Joe
I had the dragdrop working copying one item to another list. But now when I try to doubleclick to "open" an item, I find myself in the drapdrop methods.
As always, I add one thing and I break another.
Thank for any help you have to offer,
Joe
lstFilename (Listbox) Methods:
Sub lstFilenames_DragDrop(sender As Object, e As DragEventArgs) Handles lstFilenames.DragDrop
If (e.Data.GetDataPresent(DataFormats.StringFormat)) Then
Dim rcvFilename As String = CStr(e.Data.GetData(DataFormats.StringFormat))
Call XferFromComp(rcvFilename)
End If
End Sub
Sub lstFilenames_DragOver(sender As Object, e As DragEventArgs) Handles lstFilenames.DragOver
e.Effect = DragDropEffects.Move
End Sub
Sub lstFilenames_KeyDown(sender As Object, e As KeyEventArgs) Handles lstFilenames.KeyDown
If e.KeyCode = Keys.Enter Then
If SelectedPathFilename <> "" Then OpenPresetFile(SelectedPathFilename)
End If
End Sub
Sub lstFilenames_MouseDown(sender As Object, e As MouseEventArgs) Handles lstFilenames.MouseDown
lstFilenames.SelectedIndex = lstFilenames.SelectedIndex
Application.DoEvents()
If lstFilenames.Items.Count = 0 Then
Return
Else
Dim selFilename As String = lstFilenames.Items(lstFilenames.SelectedIndex).ToString
Dim dde As DragDropEffects
dde = DoDragDrop(selFilename, DragDropEffects.Move)
End If
Application.DoEvents()
Select Case e.Clicks
Case 2
If SelectedPathFilename <> "" Then OpenPresetFile(SelectedPathFilename)
Application.DoEvents()
End Select
End Sub
Last edited: