News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

QA: Why does not keyboard navigation work with HTML control?

By Yaroslav Goncharov, February 05, 2003.
Print version

Question

HTML control does not respond to keyboard events in my Pocket PC application. How can I enable keyboard navigation in the HTML control?

Answer

There are 2 aspects that can disable keyboard navigation: an invalid initial focus and a dialog-based parent.

A dialog-based parent consumes keyboard events and does not give a chance to the HTML control to get them. There are several possibilities to fix it, but for the simplest solution use a generic parent window instead of a dialog.

Another interesting point is keyboard focus. The HTML control consists from 2 windows. You should set a focus to the inner window to enable keyboard navigation. A good place to do it is the end of the parent window's WM_CREATE handler.

HWND hWndInternal = GetWindow(hwndHtmlCtrl, GW_CHILD); SetFocus(hWndInternal);

Related resources:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House