c# - WebBrowser Click-Event -


i want program screensaver , since have html5 code want use webbrowser control renders content. can't figure out how exit application on events "click", "keydown", etc. webbrowser class doesn't seem know events. can tell me how can make application exit?

here's code:

public screensaver() {     initializecomponent();      this.load += screensaver_load;     startbrowser(); }  private void startbrowser() {     this.webbrowser1.documenttext = content; }  private void screensaver_load(object sender, eventargs e) {     this.formborderstyle = formborderstyle.none;     this.bounds = screen.primaryscreen.bounds;     cursor.hide();     this.topmost = true;     this.backcolor = color.white;     this.webbrowser1.size = new system.drawing.size(this.clientsize.width, this.clientsize.height); }  private string content  {         {         return "<html>..[long html code following]..</html>";     } } 

you can use javascript function close current application in browser example:

  <a href="#" onclick="close_window();return false;">close</a> 

Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -