Mar 14, 2009

Error the calling thred must be STA, because many UI components require this


Tips:


Thread thread = new Thread(new ThreadStart(CreateUIInAnotherThread));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();

 
private void CreateUIInAnotherThread()
{
Window wd = new Window();
        wd.Show();
}




No comments:

Post a Comment