webbrowser control on form2 vb windows application
- by user228058
Hi,
I have a vb windows application with 2 forms, where form2 is called from form1 using
form2.showdialog()
I added a web browser control to form2, and I'm getting the following error at the point where form2 is called:
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
I tried:
1) adding STAThread() to the form_load()
2) I added a module to my application, and created a sub main(), with the STAThread attribute applied to it
3) I marked the sub startup() with STAThread()
And none of this helped.
Any tips on how to get around this issue?
Thanks,
rcpg