views:

285

answers:

1

As the subject is self explainatory, I need help.

I'm writing 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.

A: 

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 {

kmontgom
it says I can use this attribute only with Method definitions, not class declarations
Emre
My mistake. Its actually applied to the Main function of your application class
kmontgom