Alex Rivera | Logout

DragDrop registration did not succeed

Asked 2008-09-25T20:25:05.983
16

System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException:

What does this exception mean? I get it at this line trying to add a panel to a panel at runtime...

splitReport.Panel1.Controls.Add(ChartPanel);

Working in VS2008 C#

Edit
Report

2 Answers

6
function abc
{
            Thread t = new Thread(new ThreadStart(xyz));
            t.SetApartmentState(ApartmentState.STA);
            t.Start( );    
}
function xyz
{
 the code of Windows form..or whatever which is causing the error
}
answered 2011-08-29T07:33:36.690
2

I'm not sure whether you have solved this problem or not. I just encountered this problem and I fixed it by deleting my bin directory.

answered 2010-02-05T06:26:05.730

Your Answer