kusanagi
kusanagi

Reputation: 14614

async delegate new form

here code

delegate void CheckNewsDelegate();

void CheckNews()
{            
    frmNews news = new frmNews();
    news.Show();            
}

CheckNewsDelegate dlg = new CheckNewsDelegate(CheckNews);
dlg.BeginInvoke(null, null);

new form not create normal. how fix it?

Upvotes: 0

Views: 374

Answers (1)

Kleinux
Kleinux

Reputation: 1541

You can do this, but need to start an application message queue on the other thread. Replace the CheckNews function with

void CheckNews()
{            
    frmNews news = new frmNews();
    Application.Run(news);         
}

Upvotes: 1

Related Questions