Welcome Guest Search | Active Topics | Sign In | Register

Get sender control in webView.Click event Options
Arsenal
Posted: Wednesday, December 20, 2017 9:33:35 AM
Rank: Newbie
Groups: Member

Joined: 1/13/2017
Posts: 2
Hi,

Maybe I am doing this wrong, but here is my problem :

I'm trying to catch the web control which was selected during an OnClicke vent associated to my EO.WebBrowser.WebView.
I would like to make a virtual keyboard appear when the user clicks on a textbox/textarea control on the page, so I need to at least get the type of the control on which the user clicked.

Kind of like this, to keep it simple :

Code: C#
private void webView_Click(object sender, EventArgs e)
{
       // Get the sender control
       var sender = ...

       // Check type and do stuff
       if(sender.type == input ...) // for example
              popKeyboard();
}
eo_support
Posted: Wednesday, December 20, 2017 3:13:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

You won't be able to get which control is clicked from the C# side. You will need to use WebView.JSInitCode to inject JavaScript code into the page that handles click event on the JavaScript side. Inside your JavaScript event handler you can check which element has received the click event and notify the C# side if needed. You would notify the C# side from your JavaScript code through this feature:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsext.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.