|
Rank: Newbie Groups: Member
Joined: 5/10/2018 Posts: 3
|
I have a winform with a webBrowser. in this web browser i need to know on wich html element the clicked mouse was realized, and not enable the navigation, by example: in a form html showed on webBrowser control, the user has click on button "send", How i can know the element that was clicked? and how avoid the action asociated to this element, on the ejemplo i need to block the sent action.
kind regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
You can inject your own JavaScript code into the page and then in your JavaScript code you can cancel the click event. You can search online on how to do this with JavaScript.
Once you have the correct JavaScript code, you can use WebView.EvalScript or set WebView.JSInitCode to run the JavaScript. The difference between these two is EvalScript is executed when your call it. JSInitCode is executed when the page is loaded BEFORE everything else runs.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/29/2019 Posts: 1
|
gabrielcastillo wrote:I have a winform with a webBrowser. in this web browser i need to know on wich html element the clicked mouse was realized, and not enable the navigation, by example: in a form html showed on webBrowser control, the user has click on button "send", How i can know the element that was clicked? and how avoid the action asociated to this element, on the ejemplo i need to block the sent action.
kind regards Hi Gabriel, do you have a workaround for this? i have the same problem, i want to know which element in webview was clicked... thanks.
|
|