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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

95624 Jul 21,2010 05:38 PM Jul 23,2010 10:28 AM Windows Forms 4
loading
Tags: HTMLUIControl
Dmitry Sergey
Asked On July 21, 2010 05:38 PM

I have loaded html-file as following:


Template













Text






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 05:49 PM

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 09:43 AM

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.

http://172.168.111.149/UG_82/WindowsFormsUI_HTMLUI/ElementEvents.html

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

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=keypress-211204258.zip

Please let me know if you have any queries.

Regards,
Lokanath.E

Dmitry Sergey
Replied On July 22, 2010 10:37 AM

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 10:28 AM

Hi Dmitry,

Thanks for your update.

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

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=keypress-768003212.zip

Please let us know if you need further assistance.

Regards,
Lokanath.E

CONFIRMATION

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.

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.

;