Click here to Skip to main content
15,122,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a form where I want to either call an already stored URL or if the relevant field is blank I want to load Google.co.uk. I am using the latest version of chrome.

Google loads in the web browser box on my form but when I try to access something from Google I get the following error:
Object doesn't support property or method 'loadeventlistner'

Any ideas how to solve this?

I am using the latest version of Visual Basic in Visual-Studio Community 2019

What I have tried:

On the form I have a command button Browse which has the code
WebBrowser.Navigate(New Uri("http://www.google.co.uk"))

where WebBrowser is the name of my browser control on the form.

Pressing the command button loads Google and I can type something into its search box. But if I try to execute the search I get the above error.

I have searched Google for a solution but to no avail.
Posted
Updated 19-Oct-21 4:33am
Comments
CHill60 19-Oct-21 8:55am
   
Which browser control are you using?
Member 14028601 19-Oct-21 12:09pm
   
I was using Chrome but I have now uninstalled that and I am using Microsoft Edge. I am getting the same problem

1 solution

As far as I know, the standard WebBrowser control shipped with Windows does not support the LoadEventListener event. It's utilising IE under the covers, but changing your IE settings in a normal browser will not propagate to the control.

There are various suggestions for a solution here javascript - Object doesn't support property or method WebBrowser Control[^]

If you want to have Chrome embedded then you will need to use a third-party library such as Cef
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900