VB6: Detect Webbrowser button click

Hi,

I've tried a few non-E-E solutions, but none seem to work for me.

I need to detect mouse click on a button in a WebBrowser OCX HTML page, in order to send the code to one of two Subs.

Does anyone have a bullet proof method to do this?

Thanks.
tvtechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob_JeffreyIT/ProgrammingCommented:
If you are writing an ActiveX control that is then being added to a web page - then the built in OnClick function is where you would place the code.

This, however, seems to be a very basic question, though, so I don't think I am understanding the question correctly.

Perhaps you are writing an ActiveX control that you want to then execute JavaScript code within the same page or something?  Can you expand your question?
0
tvtechAuthor Commented:
I'm using a standard Webbrowser OCX on a VB6 form. The Webbrowser displays an intranet web page,  which has four named buttons. I need to know when the OnClick event occurs, when one of the buttons is clicked, so that I tell my code what to do when that specific button is clicked.

The Webbrowser does not have an OnClick event and no, I am not writing an OCX.

Thanks.
0
Rob_JeffreyIT/ProgrammingCommented:
Take a look at the article on MSDN about handling events within a VB6 application called from source HTML hosted in a WebBrowser control, this looks like what you want to do.

https://msdn.microsoft.com/en-ca/library/aa752045%28v=vs.85%29.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tvtechAuthor Commented:
Rob, thanks very much. Works great!
0
tvtechAuthor Commented:
Great answer. Just don't forget to set 'My_Default_Method' as the Default, or it won't show the Button.onClick msgbox. :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.