Tuesday, September 22, 2009

On-Screen Keyboards In WPF

Update 18/01/2011 : Check out this code project article if you're interested in an on-screen keyboard implemented in WPF; http://www.codeproject.com/KB/miscctrl/Virtual-WPF.aspx

The most popular post on my blog is an old one about creating on-screen/touch screen keyboard in Windows Forms. This isn’t surprising, I guess, since doing so is full of subtle traps that makes the process quite difficult when you first look into it. The Internet, and http://www.codeproject.com/ in particular, have all the information you need to get it right but it is mostly distributed among different articles and pages and not gathered all in one place, so doing the research can be time consuming, hence the popularity of my article which contains all the magic ingredients.
However, as pointed out by “Oregon Ted” in the comments on my post, the solution doesn’t work in WPF as the trick used to show a window without activating it doesn’t apply to the WPF object model. Luckily, Google found the answer on another blog (IRhetoric);
http://rhizohm.net/irhetoric/blog/9/default.aspx
By using the technique shown in the link to show a WPF window without activation, and the other tips in my old post, you should be able to get an on-screen keyboard working in WPF with a minimum of fuss. I haven’t tried it myself though… so if anyone does please leave a comment to share your experiences.

No comments:

Post a Comment