开发者

ActiveX control cannot be instantiated because the current thread is not in a single-threaded apartment

As the subject is self explainatory, I need help.

I'm writ开发者_运维百科ing a small tool that displays a splash screen when starting. The splash screen is a Form. When there was only a Button control on it it was working fine. But when I removed it and placed a WebBrowser control on it, it throws the above exception.

Thanks in advance.


Are you using WinForms? If so, try placing the [STAThread] attribute at the top of your class definition and see what happens:

namespace WindowsFormsApplication1 { [STAThread] public partial class Form1 : Form {

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜