Can't get webBrowser control to work in module

Topics: CAB & Smart Client Software Factory
Oct 21, 2005 at 10:11 AM
originally posted by: aleung61

Sorry if this is a newbie question. I wanted to create a module that contains a webBrowser control. It wasn't working out, so I loaded the CABWalkthrough project. (Oct CAB + RC1 of VS2005). I built and ran the project and "Hello World" appears as expected. I then just dropped a webBrowser control into myview.cs (no code). When I ran the project, the "Hello World" text does not show up (no errors reported). I removed the webBrowser and tried other controls (TextBox, RichTextBox, PictureBox) and the project runs fine. I also created a plain Windows Application with a webBrowser and it worked fine.

Is there something special that I need to do to use the webBrowser control in a module?
Oct 21, 2005 at 12:47 PM
originally posted by: BradWilsonMSFT

The CustomerMapExtension project in the BankTeller quick start uses the browser control. As far as I know, it was just dragged and dropped right onto the user control, and it works fine.
Oct 22, 2005 at 4:18 AM
originally posted by: aleung61

Thanks for your response. I looked a little closer at the CABWalkthrough. The presenter subscribes to the Load event of the view interface. It appears that the Load event doesn't fire when the webBrowser control is on the User Control. I also took a quick look at the BankTeller Quickstart and it does not appear to use the Load Event.

I searched through the message board and found a message posted 8/17/2005 concerning a problem with the webBrowser and the UserControl's OnLoad event. Could this be the same issue?
Aug 24, 2006 at 7:27 PM
originally posted by: mshe

Was this issue solved?

I think I'm having the same problem - when I use a webBrowser control on the page, the Mybase.Load immediate runs and ignores my CreateNew injection.
Aug 24, 2006 at 11:28 PM
originally posted by: mamu300B

no problem at all over here while adding the WebBrowser control to my SmartPart which is a UserControl.
CreateNew and Load event all work fine.
Are you sure you use the System.Windows.Forms.WebBrowser?