Solved

VB.net Drag and drop not working on a TaskPane

Posted on 2013-02-03
6
249 Views
Last Modified: 2013-02-09
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.
0
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 38848382
Hi ...Can you show some Code?
0
 

Author Comment

by:murbro
ID: 38848396
Here's the code where it works. If I try to do the same with a ListBox it doesn't


 Private Sub txtWhereColumnVariables_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles txtWhereColumnVariables.DragDrop
        Try
 
            Dim oDroppedText As String
            If e.Data.GetDataPresent(System.Windows.Forms.DataFormats.StringFormat) Then
                oDroppedText = e.Data.GetData(System.Windows.Forms.DataFormats.StringFormat).ToString()
                Me.txtWhereColumnVariables.Text = oDroppedText

                If Globals.ThisAddIn.oRIGHT.lblDataBaseType.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(oTableName, 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(oTableName, 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
0
 
LVL 18

Assisted Solution

by:John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou earned 250 total points
ID: 38848417
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:murbro
ID: 38848489
Thanks.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 38848555
0
 

Author Closing Comment

by:murbro
ID: 38871426
Thanks for the help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question