Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OnClick an WebBrowser Klasse Schicken

Empfohlene Antworten

Veröffentlicht

Hallo.

Ich habe ein Problem bei meiner Windows Forms Anwendung:

Sie beinhaltet ein webBrowser Control, das ermöglicht eine Webseite in einer Form anzuzeigen.

Jetzt möchte ich aber durch "Externe Buttons" (Buttons die zur Windows Form und nicht zur HTML Seite gehören) OnClick EventHandler an die Webseite schicken, so wie es auch die Buttons in einem HTML Dokument machen.

So sieht das in der HTML Seite aus. Da wird die JavaScript Methode "DoSomething()" aufgerufen, die in der HTML seite definiert ist.


<a href="#" onClick="doSomething();">Hallo</a>

Jetzt möchte ich aber, dass mein WIndows.Forms Button etwas an den Webbrowser schickt, dass mein Button auch so einen onClick Eventhandler an die HTML seite schicken kann.

Das muss doch möglich sein, oder?

Liebe Grüße

errox

Hallo errox,

probiers mal damit:


this.webBrowser1.Document.GetElementById("deinLink").RaiseEvent("onclick");

Du wirst deinem Anchor dann wohl noch eine ID zuweisen müssen.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.