0

I am creating an application to open a website in a c# webbrowser control, and track the elements being clicked from that website. So I chose to make a c# application with a webbrowser and on click within the website the elements being clicked are to be logged. I'm having a problem on finding the most efficient way to handle mouse click events of the website within the webbrowser.

3 methods which I found out:

  • Applying a transparent panel in front of the webbrowser so that when a click is done the mouse coordinates are used to get the element inside the webbrowser and further on log it.
  • Applying the logging system on document loading complete.
  • Applying a timer with a very low interval to detect any clicks done within the webbrowser control.

I am using the first method but I'm having a bit of problems on hiding the transparent panel when a click is done and replicating the click, but I believe a I can find a solution to this. I chose not to use the second method because when the webbrowser is changing website the trigger event doesn't work correctly. And the 3rd method will require alot of unneeded resources to log the clicks.

Is there any suggestions on how to make the system more efficient?

13
  • The transparent panel will also make your life complicated if the Web Page scrolls about. What about the OnNavigate event? Commented Jan 24, 2014 at 14:35
  • Yes, transparent has those drawbacks indeed.. You would choose the timer method? Commented Jan 24, 2014 at 14:38
  • I'm not sure. What are you actually trying to do? Why do you need to know that a button has been clicked? Commented Jan 24, 2014 at 14:39
  • I'm just doing a logging system that lists down the elements within the website being clicked, this can further on be used to make an analysis on which elements are most used or replicate the elements sequence clicked. Commented Jan 24, 2014 at 14:43
  • Is this WebSite your own? Can you change it? Commented Jan 24, 2014 at 14:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.