views:

120

answers:

1

I've got a winform with a webbrowser control. The URL is a web page containing a java applet showing my web cam. What I'd like to do is minimize the form when I click anywhere in the region of the webbrowser control / webcam image. I tried messing around with transparent buttons but could not get anything to work. Since there is no OnClick event for the web browser control I'm not sure how to do this. I can modify the web cam page, could this be done somehow through javascript in the page itself calling back to a method in the winform? [grasping at straws...]

+1  A: 

This is a hack, but if it works, it's an idea...

In the web page containing the java applet,. can you include the applet inside a hyperlink pointing back to the same page? Then when the user clicks on the hyperlink, you can tap into the WebBrowser.Navigated event.

However, just picturing that from a user perspective, I hate the idea. If the WebBroser control is in a Windows Form, why would you not just include a minimize button on the form? The principle of not surprising the user comes to mind.

David Stratton
I tried that but it didn't work. Neither did wrapping it in a div with an onclick. I also tried putting a div over the applet but found out the z-index for an applet is "infinity" (someone else's forum comment). I also tried the onclick in the applet by changing the <applet> tag to <object> (w3.org says you can) but it wouldn't fire. Image maps didn't work either. Unless someone else has an idea the only thing I can think of is to learn enough about Java and decompile the .class file then rebuild it with a click event.
nbdeveloper
No one else has answered so I'll make your answer for the effort. I gave up on the click thing. It's just a personal toy on my home computer anyway.
nbdeveloper