DragDrop registration did not succeed

I am using Visual Studio 2005.

In the event handler of a Timer on a form I am setting some of the fields visible. But I get a "DragDrop registration did not succeed" error. This does not happen if I just the fields' enabled property.

Can someone please tell me what I need to do?
emdsftAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
What does your form do?

Can you show us the code in the Timer event?
0
emdsftAuthor Commented:
Actually its not a timer but an event from a DLL  

   Private Sub Core_Tufter_YarnFeedEnabledChanged(ByVal Index As Integer, ByVal Enabled As Boolean)
        Core.StatusPnlArray(Index).Enabled = Enabled
        Core.SettingsValLblArray(Index).Visible= Enabled             '// This is where I get the error.
        Core.FeedTypeLblArray(Index).Visible= Enabled
        If Not Enabled Then
            Core.StatusPnlArray(Index).BackgroundImage = My.Resources.YarnFeed_Gray
            Core.SettingsValLblArray(Index).Text = ""
            Core.FeedTypeLblArray(Index).Text = ""
        End If
    End Sub

I have set Control.CheckForIllegalCrossThreadCalls = False in Form Load.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
Try using a Delegate:

    Private Delegate Sub YarnFeedDelegate(ByVal Index As Integer, ByVal Enabled As Boolean)

    Private Sub Core_Tufter_YarnFeedEnabledChanged(ByVal Index As Integer, ByVal Enabled As Boolean)
        UpdateYarnFeed(Index, Enabled)
    End Sub

    Private Sub UpdateYarnFeed(ByVal Index As Integer, ByVal Enabled As Boolean)
        If Me.InvokeRequired() Then
            Dim yfd As New YarnFeedDelegate(AddressOf Me.UpdateYarnFeed)
            Me.Invoke(yfd, New Object() {Index, Enabled})
        Else
            Core.StatusPnlArray(Index).Enabled = Enabled
            Core.SettingsValLblArray(Index).Visible= Enabled
            Core.FeedTypeLblArray(Index).Visible= Enabled
            If Not Enabled Then
                Core.StatusPnlArray(Index).BackgroundImage = My.Resources.YarnFeed_Gray
                Core.SettingsValLblArray(Index).Text = ""
                Core.FeedTypeLblArray(Index).Text = ""
            End If
        End If
    End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TomlinsonMiddle School Assistant TeacherCommented:
In general,

    Control.CheckForIllegalCrossThreadCalls = False

is a BAD idea.  That is why it is True by default.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.