Solved

VB.net Drag and drop not working on a TaskPane

Posted on 2013-02-03
6
250 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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