I was wondering how to click on any textbox and call upon an application like on screen keyboard every time I click on them. Does WPF limit me to just the program or can I click on any textbox, like on browsers as well?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can certainly do this – I am doing pretty much exactly what you’re asking in an SDK I have written. You can define an attached dependency property that subscribes to the focus and left click events for a textbox. These handlers then trigger the onscreen keyboard to get displayed.
To apply this attached dependency property to all your textboxes you simply define a global style for text boxes. So the global style will look like the following. Note how both the key and target type have the same value. This is what makes your app apply it to all textboxes in the app. You just need to put this style in a global location in your app, e.g. the resources section of your App.xaml.
Here is a cut down version of my attached dependency property, you need to fill in the blanks to popup your on-screen keyboard:
Note that this approach only works for your current WPF application. You will need to look at hooking mechanisms if you want to do this for other processes. E.g. You could use the Microsoft Active Accessibility APIs or a hooking library like EasyHook.