Murray Brown
asked on
VB.net Drag and drop not working on a TaskPane
Hi
I have a TaskPane in my VB.net app where I had drag and drop working
on a RichTextBox. I then tried to cancel this and do the same on a ListBox but nothing works
even though I have set Allow Drop to true.
I have a TaskPane in my VB.net app where I had drag and drop working
on a RichTextBox. I then tried to cancel this and do the same on a ListBox but nothing works
even though I have set Allow Drop to true.
Hi ...Can you show some Code?
ASKER
Here's the code where it works. If I try to do the same with a ListBox it doesn't
Private Sub txtWhereColumnVariables_Dr agDrop(ByV al sender As Object, ByVal e As System.Windows.Forms.DragE ventArgs) Handles txtWhereColumnVariables.Dr agDrop
Try
Dim oDroppedText As String
If e.Data.GetDataPresent(Syst em.Windows .Forms.Dat aFormats.S tringForma t) Then
oDroppedText = e.Data.GetData(System.Wind ows.Forms. DataFormat s.StringFo rmat).ToSt ring()
Me.txtWhereColumnVariables .Text = oDroppedText
If Globals.ThisAddIn.oRIGHT.l blDataBase Type.Text = "Access" Then
If Mid(oDroppedText, 1, 1) = "[" Then
Dim arrSplit As Object = Split(oDroppedText, ".")
Dim oTableName As String = Mid(arrSplit(0), 2, Len(arrSplit(0)) - 2)
Dim oColumnName As String = Mid(arrSplit(1), 2, Len(arrSplit(1)) - 2)
Dim oResult As String = oGet_Access_Data_Type_Look (oTableNam e, oColumnName)
Me.txtWhereColumnVariables .Text = Me.txtWhereColumnVariables .Text & " " & oResult
Call oLoadListBox(oTableName, oColumnName)
End If
Else
If Mid(oDroppedText, 1, 1) = "[" Then
Dim arrSplit As Object = Split(oDroppedText, ".")
Dim oTableName As String = Mid(arrSplit(0), 2, Len(arrSplit(0)) - 2)
Dim oColumnName As String = Mid(arrSplit(1), 2, Len(arrSplit(1)) - 2)
Dim oResult As String = Get_SQL_Data_Type_Look(oTa bleName, oColumnName)
Me.txtWhereColumnVariables .Text = Me.txtWhereColumnVariables .Text & " " & oResult
Call oLoadListBox(oTableName, oColumnName)
End If
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub txtWhereColumnVariables_Dr
Try
Dim oDroppedText As String
If e.Data.GetDataPresent(Syst
oDroppedText = e.Data.GetData(System.Wind
Me.txtWhereColumnVariables
If Globals.ThisAddIn.oRIGHT.l
If Mid(oDroppedText, 1, 1) = "[" Then
Dim arrSplit As Object = Split(oDroppedText, ".")
Dim oTableName As String = Mid(arrSplit(0), 2, Len(arrSplit(0)) - 2)
Dim oColumnName As String = Mid(arrSplit(1), 2, Len(arrSplit(1)) - 2)
Dim oResult As String = oGet_Access_Data_Type_Look
Me.txtWhereColumnVariables
Call oLoadListBox(oTableName, oColumnName)
End If
Else
If Mid(oDroppedText, 1, 1) = "[" Then
Dim arrSplit As Object = Split(oDroppedText, ".")
Dim oTableName As String = Mid(arrSplit(0), 2, Len(arrSplit(0)) - 2)
Dim oColumnName As String = Mid(arrSplit(1), 2, Len(arrSplit(1)) - 2)
Dim oResult As String = Get_SQL_Data_Type_Look(oTa
Me.txtWhereColumnVariables
Call oLoadListBox(oTableName, oColumnName)
End If
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Thanks for the help