Solved

RichTextBox drag_drop event not firing

Posted on 2014-11-04
2
150 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
ID: 40423131
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
ID: 40430881
Thanks very much
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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 …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

821 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