Thursday, January 1, 2009

Drag and Drop richtextbox update…

I almost forgot to mention a little couple details for the previous post…

First off – got an email from Jason who asked about why the code doesn’t work for him.  I took a look at his code implementation and what he’s missing is something I drop in my form load area.  By setting RichTextBox1.AllowDrop to TRUE (in the form load) when the form is loaded and the richtext box control is created, it allows drag and drop operations.  Now I know – I know – by default the richtextbox control is supposed to have the drag and drop automatically set to allow it. 

Now, oddly enough – in my research I’ve found that not all properties dialogs out there (VS2005) for the richtextbox control have the property to set for this in the properties dialog.  I have confirmed – that you can set this in the code as showen below in 2005.  I’m still trying to find out if this is with all richtextbox controls – or if a 3rd party addon or control is what is causing the issue. 

In any case – you can set it programmatically which is what I’ve always done which is why I’m at a bit of a loss as to what the cause of this problem is.  Jason’s confirmed that setting this programmatically worked for him.

Public Class Form1
    Private Sub Form1_Load(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
        'This call is required by the Windows Form Designer.
      
RichTextBox1.AllowDrop =True
    End Sub

In my rush to send that out this morning I probably should have discussed – or commented the code a bit better.  By default

No comments: