Solved

RichTextBox drag_drop event not firing

Posted on 2014-11-04
2
139 Views
Last Modified: 2014-11-08
On my form load I have the code: Me.RichTextBox2.AllowDrop = True

Then I have the code below but the DragDrop event doesn't fire (even though other regular text boxes accept the drop)

    Private Sub RichTextBox2_DragEnter(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles RichTextBox2.DragEnter
        e.Effect = DragDropEffects.Copy
    End Sub

    Private Sub RichTextBox2_DragDrop(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles RichTextBox2.DragDrop
    <CODE HERE DOES NOT FIRE>
End Sub
0
Comment
Question by:murbro
2 Comments
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
Comment Utility
It's possible if there's no valid data the dragdropeffects.copy may not take affect.
also try setting allowdrop in the designer to make sure it's taking.
try this in the drag enter event:
   If (e.Data.GetDataPresent(DataFormats.Text)) Then
      e.Effect = DragDropEffects.Copy
   Else
      e.Effect = DragDropEffects.None
   End If
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks very much
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now