We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I catch ''KeyPress'' event on a page without any elements?

Thread ID:





95624 Jul 21,2010 09:38 PM UTC Jul 23,2010 02:28 PM UTC WinForms 4
Tags: HTMLUIControl
Dmitry Sergey
Asked On July 21, 2010 09:38 PM UTC

I have loaded html-file as following:



How can I catch 'KeyPress' event for such kind of loaded HTML to initiate any actions on it?

Thanks in advance.

Dmitry Sergey
Replied On July 21, 2010 09:49 PM UTC

I have tried to use code:

private void htmluiControl1_LoadFinished(object sender, EventArgs e)
IHTMLElement[] elem = this.htmluiControl1.Document.GetElementsByName("body");
elem[0].KeyPress += new EventHandler(this.ElementKeyPress);

But it doesn't work...

Lokanath E [Syncfusion]
Replied On July 22, 2010 01:43 PM UTC

Hi Dmitry,

Thanks for using Syncfusion products.

KeyPress event will be fired only for supporting elements. Refer the documentation from following link to get more details about this.

Refer the sample from the following link which demonstrates the above,


Please let me know if you have any queries.


Dmitry Sergey
Replied On July 22, 2010 02:37 PM UTC

Earlier I could use JavaScript to process pressing some key:


But now I cannot :( It's too sorry...

Thank you anyway for your help.

Lokanath E [Syncfusion]
Replied On July 23, 2010 02:28 PM UTC

Hi Dmitry,

Thanks for your update.

We have attached a sample to demonstrate how scripts can be used with HTMLUI at the following link


Please let us know if you need further assistance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon